home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / lsddemomenu.lha / titlemenu.s < prev    next >
Encoding:
Text File  |  1990-09-07  |  43.4 KB  |  2,522 lines

  1.  
  2.     Section titlemenu,code
  3.     opt    c-,o+,w-
  4.  
  5.     ; i assume you have use one these before, if you have any
  6.     ; problems ring me (shagratt).
  7.     
  8.     ; in this menu you can change all text, music, bobs, font, logo
  9.  
  10.     ; if you want to change the bobs, this is the format for it!
  11.     ;
  12.     ;    bobs - ball: 16x15 (8 colours) - cmap before
  13.     ;           mask: 16x15 (8 colours) - no cmap
  14.     ;
  15.     ; cut out with kefrens iff conv
  16.  
  17.  
  18. forecol        equ    $180        ; back ground colour
  19. textcol        equ    $190        ; text colour
  20. linecol        equ    $008        ; text colour
  21. topcur        equ    $5c01        ; start of selector line
  22. tall        equ    10        ; height of text
  23.  
  24.  
  25. xstep1        equ    2        ; after every snake
  26. ystep1        equ    2        ; after every snake
  27.  
  28. xstep2        equ    3        ; after every bob
  29. ystep2        equ    1        ; after every bob
  30.  
  31. loop        = 0            ; 0=exit, 1=no exit
  32.  
  33.     ************************************************************
  34.  
  35.     ; to make the menu return after each programme set loop to
  36.     ; 1 (above) on final assemblly
  37.         
  38.     ************************************************************
  39.     
  40. begin1:    bsr    vcheck
  41.  
  42.     clr.l    d0
  43.     clr.l    d1
  44.     clr.l    d2
  45.     clr.l    d3
  46.     clr.l    d4
  47.     clr.l    d5
  48.     clr.l    d6
  49.     clr.l    d7
  50.  
  51.     move.l    4.w,a6
  52.     jsr    -132(a6)    ; forbid
  53.  
  54.     move.l    #0,quit
  55.     move.l    #scrolltext,scrollptr
  56.  
  57.     lea    $dff120,a0    ; kill sprites
  58.     moveq.w    #15,d0
  59. sprloop:    move.w    #-1,(a0)+
  60.     dbf    d0,sprloop
  61.  
  62.     move.l    4.w,a6
  63.     move.l    #scrsize*4,d0
  64.     move.l    #$10002,d1
  65.     jsr    -198(a6)
  66.     beq    reset
  67.     move.l    d0,screen
  68.  
  69.     move.l    4.w,a6
  70.     move.l    #40*256,d0
  71.     move.l    #$10002,d1
  72.     jsr    -198(a6)
  73.     beq    reset
  74.     move.l    d0,scr
  75.  
  76.     lea    ball,a0
  77.     lea    cmap,a1
  78.     add.l    #2,a1
  79.     move.w    #7,d0
  80. cmaploop:
  81.     move.w    (a0)+,(a1)
  82.     add.l    #4,a1
  83.     dbf    d0,cmaploop
  84.  
  85.     move.l    screen,a0
  86.     move.l    a0,screen1
  87.     add.l    #scrsize,a0
  88.     move.l    a0,screen2
  89.     
  90.     move.w    #(maxx*32)-1,d0
  91.     lea    coords1,a0
  92.     lea    coordsend1,a2
  93. block_move:
  94.     move.l    (a0)+,(a2)+    
  95.     dbf    d0,block_move
  96.  
  97.     clr.l    d0
  98.     move.b    $dff00a,d0
  99.     move.l    d0,oldy
  100.  
  101.     lea    glib,a1
  102.     moveq    #0,d0
  103.     move.l    4.w,a6
  104.     jsr    -$228(a6)
  105.     tst    d0
  106.     beq    error
  107.     move.l    d0,graphics
  108.  
  109.     lea    logocmap+2,a0
  110.     lea    logo,a1
  111.     move.w    #15,d0
  112. cmap2loop:
  113.     move.w    (a1)+,(a0)
  114.     add.l    #4,a0
  115.     dbf    d0,cmap2loop    
  116.  
  117.     move.l    #logo+32,d0
  118.     move.w    d0,bplane0_lo
  119.     swap    d0
  120.     move.w    d0,bplane0_hi
  121.     swap    d0
  122.     add.l    #40*50,d0    
  123.     move.w    d0,bplane1_lo
  124.     swap    d0
  125.     move.w    d0,bplane1_hi
  126.     swap    d0
  127.     add.l    #40*50,d0    
  128.     move.w    d0,bplane2_lo
  129.     swap    d0
  130.     move.w    d0,bplane2_hi
  131.     swap    d0
  132.     add.l    #40*50,d0    
  133.     move.w    d0,bplane3_lo
  134.     swap    d0
  135.     move.w    d0,bplane3_hi
  136.  
  137.     move.l    #info,page
  138.     bsr    setup_screen
  139.     move.l    #page1,page
  140.     bsr    setup_screen
  141.  
  142.     move.l    #-1,step
  143.     
  144.     move.l    graphics,a6
  145.     add.l    #$32,a6
  146.     move.w    #$80,$dff096        ; dma control write
  147.     move.l    (a6),old_copper        ; store the address of the
  148.     lea    my_copper,a0
  149.     move.l    a0,(a6)            ; old copperlist
  150.     move.w    #$8080,$dff096        ; dma control write
  151.     move.w    #$8010,$dff09a        ; interupt enable bits
  152.     move.l    $6c.w,old_interupt    ; store old level 3 int
  153.     lea    new_interupt,a0
  154.     move.l    a0,$6c.w        ; store my routine
  155.  
  156.     bsr    help
  157.  
  158.     bsr    mt_init
  159.     bsr    waitmouse
  160.     bsr    mt_end
  161.     
  162.     move.l    old_interupt,$6c.w    ; resore old level 3 int
  163.     move.l    #$10,$dff09a         ; Disable Level 3 Interupt
  164.     move.l    graphics,a6
  165.     add.l    #$32,a6
  166.     move.w    #$0080,$dff096
  167.     move.l    old_copper,(a6)        ; restore old copper list
  168.     move.w    #$8080,$dff096
  169.     
  170.     move.l    4.w,a6
  171.     move.l    screen,a1
  172.     move.l    #scrsize*4,d0
  173.     jsr    -210(a6)
  174.  
  175.     move.l    4.w,a6
  176.     move.l    scr,a1
  177.     move.l    #40*256,d0
  178.     jsr    -210(a6)
  179.  
  180.     move.l    4.w,a6
  181.     jsr    -138(a6)        ; permit
  182.  
  183.     bsr    loadfile
  184.  
  185.     move.l    filename,a0
  186.     cmp.l    #"run ",(a0)
  187.     beq    error
  188.     cmp.l    #"RUN ",(a0)
  189.     beq    error
  190.  
  191.     IFNE    loop
  192.     bra    begin1
  193.     ENDC
  194.  
  195. Error:    move.w    #0,$bfec00        ; empty buffer
  196.     moveq    #0,d0            ; fin
  197.     rts
  198.  
  199.  
  200. loadfile:
  201.     bsr    checksum
  202.     move.l    d5,$f0
  203.     
  204.     move.l    #256,d0
  205.     sub.l    ypos,d0
  206.     
  207.     divu    #tall,d0
  208.     and.l    #$ffff,d0
  209.     
  210.     mulu    #4,d0
  211.     lea    flist,a0
  212.     add.l    d0,a0
  213.     
  214.     move.l    (a0),filename
  215.  
  216.     lea    doslib,a1
  217.     moveq    #0,d0
  218.     move.l    4.w,a6
  219.     jsr    -$228(a6)
  220.     tst    d0
  221.     beq    err
  222.     move.l    d0,dosbase
  223.     
  224.     move.l    d0,a6
  225.     clr.l    d0
  226.     move.l    filename,d1
  227.     move.l    #0,d2
  228.     move.l    #0,d3    
  229.     jsr    -222(a6)
  230.  
  231.     move.l    graphics,a6
  232.     add.l    #$32,a6
  233.     move.l    old_copper,(a6)        ; restore old copper list
  234.  
  235. EndCode:
  236.  
  237.     Clr.l    d0
  238.     Rts
  239.  
  240. Err:    move.w    #$fffe,d0
  241. errloop:
  242.     Move.w    $dff006,$dff180
  243.     dbf    d0,errloop
  244.  
  245.     move.l    graphics,a6
  246.     add.l    #$32,a6
  247.     move.l    old_copper,(a6)        ; restore old copper list
  248.  
  249.     Bra    EndCode
  250.  
  251.  
  252.  
  253. waitmouse:
  254.     cmp.l    #0,quit
  255.     beq    waitmouse
  256.  
  257.     move.l    #256,d0
  258.     sub.l    ypos,d0
  259.     
  260.     divu    #tall,d0
  261.     and.l    #$ffff,d0
  262.     
  263.     mulu    #4,d0
  264.     lea    flist,a0
  265.     add.l    d0,a0
  266.     
  267.     move.l    (a0),a0
  268.     cmp.b    #0,(a0)
  269.     bne    error            ; do a rts
  270.     
  271.     move.l    #0,quit
  272.     bra    waitmouse
  273.  
  274. vcheck:
  275.     rts
  276.     move.l    4.w,a6
  277.     tst.l    $2a(a6)        ; check execbase,
  278.     bne.s    virus
  279.     tst.l    $2e(a6)        ; ptrs and
  280.     bne.s    virus
  281.     tst.l    $22a(a6)        ; coolcapture
  282.     bne.s    virus
  283.     rts
  284.     
  285. virus:    lea    $dff000,a3
  286.     move.l    #$40000,d0
  287.     move.w    #$7fff,$96(a3)
  288.     
  289. vloop:    
  290.     move.w    $06(a3),d1
  291.     and.w    #$f00,d1
  292.     move.w    d1,$180(a3)
  293.     subq.l    #1,d0
  294.     bne.s    vloop
  295.  
  296. reset:    move.l    4.w,a6
  297.     clr.l    $026(a6)        ; hard reset
  298.     lea    $fc00d0,a5
  299.     jmp    -$1e(a6)
  300.  
  301. setcopper:
  302.     move.l    a0,d0
  303.     move.w    d0,bp0_lo
  304.     swap    d0
  305.     move.w    d0,bp0_hi
  306.  
  307.     move.l    graphics,a6
  308.     add.l    #$32,a6
  309.     lea    copper2,a0
  310.     move.l    a0,(a6)            ; old copperlist
  311.  
  312.     rts
  313.  
  314.  
  315. checksum:
  316.     lea    begin1(pc),a0
  317.     lea    begin2(pc),a1
  318.     move.l    a1,d2
  319.     sub.l    a0,d2
  320.     
  321.     clr.l    d5
  322.     clr.l    d0
  323. checkloop:
  324.     move.b    (a0),d0
  325.     add.l    d0,d5
  326.     
  327.     sub.l    #1,d2
  328.     bpl.s    checkloop
  329.     
  330.     rts
  331.  
  332. readjoy:
  333.     move.w    $dff00c,d0
  334.     and.w    #$100,d0
  335.     bne    joyup
  336.     move.w    $dff00c,d0
  337.     and.w    #$001,d0
  338.     bne    joydown
  339.     
  340.     btst    #7,$bfe001
  341.     beq    keyquit
  342.     
  343.     rts
  344.     
  345. joyup:    add.l    #1,ypos
  346.     move.l    #+1,step    
  347.     rts    
  348.  
  349. joydown:sub.l    #1,ypos
  350.     move.l    #-1,step    
  351.     rts    
  352.      
  353. changesnake:    
  354.     move.b    $bfec01,d0
  355.     cmp.b    #161,d0
  356.      beq    xsplus
  357.     cmp.b    #165,d0
  358.      beq    xsmin
  359.     cmp.b    #131,d0
  360.      beq    ysplus
  361.     cmp.b    #195,d0
  362.      beq    ysmin
  363.     cmp.b    #115,d0
  364.      beq    help
  365.     cmp.b    #065,d0
  366.      beq    del
  367.      
  368. snakeerror:
  369.      rts
  370.  
  371. help:    
  372.     move.l    #xs1,modpointerx
  373.     move.l    #ys1,modpointery
  374.     rts
  375. del:    
  376.     move.l    #xs2,modpointerx
  377.     move.l    #ys2,modpointery
  378.     rts
  379.      
  380. xsplus:
  381.     move.l    modpointerx,a0
  382.     move.l    (a0),d0
  383.     add.l    #2,d0
  384.     cmp.l    #20,d0
  385.     bgt.s    snakeerror    
  386.     move.l    d0,(a0)
  387.     rts
  388. xsmin:
  389.     move.l    modpointerx,a0
  390.     move.l    (a0),d0
  391.     sub.l    #2,d0
  392.     bmi    snakeerror
  393.     move.l    d0,(a0)
  394.     rts
  395. ysplus:
  396.     move.l    modpointery,a0
  397.     move.l    (a0),d0
  398.     add.l    #2,d0
  399.     cmp.l    #20,d0
  400.     bgt.s    snakeerror    
  401.     move.l    d0,(a0)
  402.     rts
  403. ysmin:
  404.     move.l    modpointery,a0
  405.     move.l    (a0),d0
  406.     sub.l    #2,d0
  407.     bmi    snakeerror
  408.     move.l    d0,(a0)
  409.     rts
  410.          
  411. readkeyboard:
  412.     move.b    $bfec01,d0
  413.     cmp.b    #103,d0
  414.     beq    keyup
  415.     cmp.b    #101,d0
  416.     beq    keydown
  417.     cmp.b    #119,d0
  418.     beq    keyquit
  419.     rts
  420.     
  421. keyup:    add.l    #10,ypos
  422.     move.l    #+10,step    
  423.     rts
  424.     
  425. keydown:sub.l    #10,ypos
  426.     move.l    #-10,step    
  427.     rts
  428.     
  429. keyquit:move.l    #-1,quit
  430.     rts
  431.          
  432. readmouse:
  433.     btst    #6,$bfe001
  434.     bne.s    nomouse
  435.     
  436.     move.l    #-1,quit
  437.     rts
  438.     
  439. nomouse:
  440.     bsr    changesnake
  441.     bsr    readkeyboard
  442.     bsr    readjoy
  443.  
  444.     clr.b    $bfec01            ; clear keyboard buffer
  445.  
  446.     clr.l    d0
  447.     clr.l    d1
  448.     
  449.     move.b    $dff00a,d0
  450.     move.l    oldy,d1
  451.     sub.l    d0,d1
  452.     move.l    d1,yp
  453.     
  454.     move.l    d0,oldy
  455.     
  456.     cmp.l    #127,yp
  457.     ble.s    mouse_not_128
  458.     sub.l    #256,yp
  459. mouse_not_128:
  460.     cmp.l    #-127,yp
  461.     bge.s    mouse_not_minus
  462.     add.l    #256,yp
  463. mouse_not_minus:
  464.  
  465.     cmp.l    #0,step
  466.     bne.s    no_change_step
  467.  
  468.     cmp.l    #0,yp
  469.     bpl.s    yp_neg
  470.     
  471.     move.l    #-10,step
  472.     bra    no_change_step
  473.     
  474. yp_neg:    move.l    #+10,step
  475.  
  476. no_change_step:
  477.     move.l    yp,d0
  478.     add.l    d0,ypos
  479. mouse_move_again:
  480.     move.l    ypos,d6
  481.     move.l    lines,d7
  482.     
  483.     cmp.l    d7,d6
  484.     bgt.s    ypos_ok1
  485.     move.l    d7,ypos
  486.     move.l    #0,d5
  487.     move.l    step,d6
  488.     sub.l    d6,d5
  489.     move.l    d5,step
  490.     
  491. ypos_ok1:
  492.     cmp.l    #255,ypos
  493.     blt.s    ypos_ok2
  494.     move.l    #255,ypos
  495.  
  496.     move.l    #0,d5
  497.     move.l    step,d6
  498.     sub.l    d6,d5
  499.     move.l    d5,step
  500.     
  501. ypos_ok2:
  502.     move.l    maxlines,d1
  503.  
  504.     move.l    #256,d0
  505.     sub.l    ypos,d0
  506.     
  507.     divu    #tall,d0
  508.     mulu    #tall,d0
  509.  
  510.     asl.l    #8,d0
  511.     add.l    #topcur,d0
  512.     
  513.     
  514.     move.l    #256,d7
  515.     sub.l    ypos,d7
  516.     
  517.     divu    #tall,d7
  518.     and.l    #$ffff,d7
  519.     
  520.     mulu    #4,d7
  521.     lea    flist,a0
  522.     add.l    d7,a0
  523.     
  524.     move.l    (a0),a0
  525.     cmp.b    #0,(a0)
  526.     bne    mouse_move_valid
  527.  
  528.     move.l    step,d7
  529.     move.l    ypos,d6
  530.     add.l    d7,d6
  531.     move.l    d6,ypos
  532.  
  533.     bra    mouse_move_again
  534.     
  535. mouse_move_valid:
  536.     move.w    d0,cursor1
  537.     add.l    #$0100,d0
  538.     move.w    d0,cursor2
  539.     add.l    #$0100,d0
  540.     move.w    d0,cursor3
  541.     add.l    #$0100,d0
  542.     move.w    d0,cursor4
  543.     add.l    #$0100,d0
  544.     move.w    d0,cursor5
  545.     add.l    #$0100,d0
  546.     move.w    d0,cursor6
  547.     add.l    #$0100,d0
  548.     move.w    d0,cursor7
  549.     add.l    #$0100,d0
  550.     move.w    d0,cursor8
  551.     add.l    #$0100,d0
  552.     move.w    d0,cursor9
  553.     add.l    #$0100,d0
  554.     move.w    d0,cursor10
  555.     add.l    #$0100,d0
  556.     move.w    d0,cursor11
  557.     add.l    #$0100,d0
  558.     move.w    d0,cursor12
  559.     add.l    #$0100,d0
  560.     
  561.     move.l    #0,step
  562.     
  563.     rts    
  564.     
  565. new_interupt:
  566.     movem.l    d0-d7/a0-a6,-(sp)    ; my scroll text
  567.     
  568.     and.w    #$10,$dff01e        ; check for copper interupt
  569.     beq     no_music
  570.     move.w    #$10,$dff09c
  571.  
  572.     bsr    gen_balls
  573.     bsr    scroller
  574.  
  575.     cmp.l    #$12345678,mt_data
  576.     beq    no_music
  577.     bsr    mt_music
  578. no_music:
  579.     bsr    readmouse    
  580.     
  581.     movem.l    (sp)+,d0-d7/a0-a6    
  582.     dc.w    $4ef9            ; jmp
  583. old_interupt:    dc.l    0        ; the old int lev 3
  584.  
  585.  
  586. scroller:
  587.     move.w    scrollpos2,d0
  588.     sub.w    #2,d0
  589.     bmi    scrolled
  590.     move.w    d0,scrollpos2
  591.     mulu    #16,d0
  592.     move.w    d0,scrollpos
  593.     rts
  594. scrolled:
  595.     
  596.     bsr    do_blit
  597.     
  598.     move.w    #0,d5
  599.     mulu    #8192,d5
  600.     or.w    #(%1001*256)+$f0,d5
  601.     
  602.     move.l    scr,a2
  603.     add.l    #190*40,a2
  604.     add.l    #24,a2
  605.     move.l    a2,a3
  606.     add.l    #2,a2
  607.     
  608.     Move.l    a3,$dff054        ; dest mem d
  609.     Move.l    a2,$dff050        ; source mem a
  610.     Move.w    #$ffff,$dff044        ; blit 1st word mask source a
  611.     move.w    #$ffff,$dff046        ; blit last word mask source a
  612.     move.w    #0,$dff064        ; blit modulo for source a
  613.     move.w    d5,$dff040
  614.     move.w    #0,$dff042        ; blit cont reg 1
  615.     Move.w    #0,$dff066        ; modulo for dest
  616.     Move.w    #(10*64)+22,$dff058    ; blit height,width
  617.  
  618.     
  619.     move.w    #4,d5
  620.     mulu    #8192,d5
  621.     or.w    #(%1001*256)+$f0,d5
  622.  
  623.     add.l    #48,a3
  624.     lea    font,a2
  625.     bsr    getscrbyte
  626.  
  627.     bsr    do_blit
  628.  
  629.     Move.l    a3,$dff054        ; dest mem d
  630.     Move.l    a2,$dff050        ; source mem a
  631.     Move.w    #$ffff,$dff044        ; blit 1st word mask source a
  632.     move.w    #$ffff,$dff046        ; blit last word mask source a
  633.     move.w    #0,$dff064        ; blit modulo for source a
  634.     move.w    d5,$dff040
  635.     move.w    #0,$dff042        ; blit cont reg 1
  636.     Move.w    #42,$dff066        ; modulo for dest
  637.     Move.w    #(9*64)+1,$dff058    ; blit height,width
  638.     
  639.     move.w    #0,d5
  640.     mulu    #8192,d5
  641.     or.w    #(%1011*256)+$fa,d5
  642.  
  643.     add.l    #44,a3
  644.  
  645.     lea    font,a2
  646.     bsr    getscrbyte
  647.  
  648.     bsr    do_blit
  649.  
  650.     Move.l    a3,$dff054        ; dest mem d
  651.     Move.l    a2,$dff050        ; source mem a
  652.     Move.l    a3,$dff048        ; source mem c
  653.     Move.w    #$ffff,$dff044        ; blit 1st word mask source 
  654.     move.w    #$ffff,$dff046        ; blit last word mask source 
  655.     move.w    #0,$dff064        ; blit modulo for source a
  656.     move.w    d5,$dff040
  657.     move.w    #0,$dff042        ; blit cont reg 1
  658.     Move.w    #42,$dff060        ; modulo for source c
  659.     Move.w    #42,$dff066        ; modulo for dest
  660.     Move.w    #(8*64)+1,$dff058    ; blit height,width
  661.  
  662.     move.w    #15,scrollpos2
  663.     move.w    #15*16,scrollpos
  664.     
  665.     rts    
  666.  
  667. getscrbyte:
  668.     clr.l    d0
  669.     move.l    scrollptr,a0
  670.     move.b    (a0)+,d0
  671.     beq    scrollfin
  672.     sub.b    #32,d0
  673.     mulu    #16,d0
  674.     add.l    d0,a2
  675.     move.l    a0,scrollptr
  676.     rts
  677. scrollfin:
  678.     move.l    #scrolltext,scrollptr
  679.     rts    
  680.  
  681.  
  682.  
  683.  
  684. setup_screen:
  685.     bsr    do_blit
  686.  
  687.     move.l    scr,$dff054                ; dest mem d
  688.     move.w    #(%0001)*256,$dff040            ; blit cont reg 0
  689.     move.w    #%0000000000000100,$dff042            ; blit cont reg 1
  690.     move.w    #0,$dff066                ; modulo for dest
  691.     move.w    #(170*64)+20,$dff058            ; blit height,width
  692.  
  693.     bsr    do_blit
  694.  
  695.     move.l    scr,a2
  696.     move.l    page,a1
  697.     add.l    #40*4,a2
  698.  
  699.     move.l    #0,lines
  700.  
  701. plot_again:
  702.     add.l    #1,lines
  703.     bsr    blit_message
  704.     add.l    #40*tall,a2
  705.  
  706.     move.b    (a1),d0
  707.     bne.s    plot_again
  708.  
  709.     move.l    #topcur,d1
  710.     move.l    lines,d0
  711.     sub.l    #1,d0
  712.     mulu    #tall*$100,d0
  713.     add.l    d0,d1
  714.     move.l    d1,maxlines
  715.     
  716.     move.l    lines,d0
  717.     sub.l    #1,d0
  718.     mulu    #10,d0
  719.     move.l    #256,d1
  720.     sub.l    d0,d1
  721.     move.l    d1,lines
  722.     
  723.     rts
  724.     
  725. blit_message:
  726.  
  727.     movem.l    d0-d7/a2-a6,-(sp)
  728.  
  729.     move.l    #0,midadd
  730.  
  731.     move.l    a1,a6
  732.     clr.b    d0
  733.     moveq.l    #-1,d1
  734.     
  735. blit_message_loop1:
  736.  
  737.     addq.l    #1,d1
  738.     move.b    (a6),d0
  739.     addq    #1,a6
  740.     cmp.b    #0,d0
  741.     bne.s    blit_message_loop1
  742.  
  743.     move.w    d1,d5
  744.     and.w    #1,d5
  745.     asl.w    #1,d5
  746.     move.w    d5,mid
  747.     
  748.     move.l    a2,midadd
  749.     move.w    d1,d5
  750.  
  751.     addq.l    #1,d1
  752.     lsr.l    #1,d1
  753.  
  754.     moveq.l    #20,d6            ; centre - lo res
  755.  
  756.     sub.l    d1,d6
  757.     add.l    d6,a2
  758.     move.l    a2,d2
  759.     and.l    #$fffffffe,d2
  760.     move.l    a2,d3
  761.     and.l    #1,d3
  762.     move.l    d2,a2
  763.     
  764.     move.w    #12,d6
  765.     cmp.l    #1,d3
  766.     beq.s    cont_blit_message
  767.     
  768.     add.w    #12,mid
  769.     subq.l    #2,midadd
  770.     
  771. cont_blit_message:
  772.     
  773.     move.w    d6,d7
  774.     mulu    #8192,d7
  775.     
  776.     subq.w    #4,d6
  777.     cmp.w    #4,d6
  778.     bne.s    other_half
  779.     
  780.     move.w    #12,d6
  781.     add.l    #80,a2
  782.     
  783. other_half:
  784.  
  785.     sub.l    #40,a2
  786.     clr.w    d0
  787.     lea    font,a0
  788.     move.b    (a1),d0
  789.     addq.l    #1,a1
  790.     cmp.b    #0,d0
  791.     bne.s    mess_is_ok
  792.  
  793.     movem.l    (sp)+,d0-d7/a2-a6    
  794.     
  795.     move.w    mid,d5
  796.     mulu    #8192,d5
  797.     or.w    #(%1001*256)+$f0,d5
  798.     
  799.     move.l    midadd,a3
  800.     jsr    do_blit
  801.     
  802.     Move.l    a3,$dff054        ; dest mem d
  803.     Move.l    a2,$dff050        ; source mem a
  804.     Move.w    #$ffff,$dff044        ; blit 1st word mask source a
  805.     move.w    #$ffff,$dff046        ; blit last word mask source a
  806.     move.w    #0,$dff064        ; blit modulo for source a
  807.     move.w    d5,$dff040
  808.     move.w    #0,$dff042        ; blit cont reg 1
  809.     Move.w    #0,$dff066        ; modulo for dest
  810.     Move.w    #(8*64)+40,$dff058    ; blit height,width
  811.  
  812.     jsr    do_blit
  813.  
  814. dont_centre:
  815.     rts
  816.     
  817.     
  818. mess_is_ok:
  819.  
  820.     cmp    #32,d0
  821.     beq    space
  822.  
  823.     sub    #32,d0
  824.     mulu    #16,d0
  825.     add    d0,a0
  826.     
  827.     Move.l    a2,$dff054        ; dest mem d
  828.     Move.l    a0,$dff050        ; source mem a
  829.     move.l    a2,$dff048        ; source mem c
  830.     Move.w    #$ffff,$dff044        ; blit 1st word mask source a
  831.     move.w    #$ffff,$dff046        ; blit last word mask source a
  832.     move.w    #0,$dff064        ; blit modulo for source a
  833.     move.w    #38,$dff060        ; blit modulo for source c    
  834.     or.w    #(%1011*256)+$fa,d7
  835.     move.w    d7,$dff040        ; blit cont reg 0
  836.     move.w    #0,$dff042        ; blit cont reg 1
  837.     Move.w    #38,$dff066        ; modulo for dest
  838.     Move.w    #(8*64)+1,d0        ; blit height,width
  839.     cmp.l    #12,d6
  840.     beq.s    not_12
  841.     Move.w    #(9*64)+1,d0
  842. not_12:    
  843.     move.w    d0,$dff058    ; blit height,width
  844.     jsr    do_blit
  845.     
  846. space:
  847.     
  848.     addq.l    #1,a2
  849.     bra    cont_blit_message
  850.  
  851. do_blit:
  852. wait_blit:
  853.     btst.b    #6,$dff002
  854.     bne.s    wait_blit
  855.     
  856.     rts
  857.  
  858. DMAWait = 300 ; Set this as low as possible without losing low notes.
  859.  
  860. n_note        EQU    0  ; W
  861. n_cmd        EQU    2  ; W
  862. n_cmdlo        EQU    3  ; B
  863. n_start        EQU    4  ; L
  864. n_length    EQU    8  ; W
  865. n_loopstart    EQU    10 ; L
  866. n_replen    EQU    14 ; W
  867. n_period    EQU    16 ; W
  868. n_finetune    EQU    18 ; B
  869. n_volume    EQU    19 ; B
  870. n_dmabit    EQU    20 ; W
  871. n_toneportdirec    EQU    22 ; B
  872. n_toneportspeed    EQU    23 ; B
  873. n_wantedperiod    EQU    24 ; W
  874. n_vibratocmd    EQU    26 ; B
  875. n_vibratopos    EQU    27 ; B
  876. n_tremolocmd    EQU    28 ; B
  877. n_tremolopos    EQU    29 ; B
  878. n_wavecontrol    EQU    30 ; B
  879. n_glissfunk    EQU    31 ; B
  880. n_sampleoffset    EQU    32 ; B
  881. n_pattpos    EQU    33 ; B
  882. n_loopcount    EQU    34 ; B
  883. n_funkoffset    EQU    35 ; B
  884. n_wavestart    EQU    36 ; L
  885. n_reallength    EQU    40 ; W
  886.  
  887. mt_init    LEA    mt_data,A0
  888.     MOVE.L    A0,mt_SongDataPtr
  889.     MOVE.L    A0,A1
  890.     LEA    952(A1),A1
  891.     MOVEQ    #127,D0
  892.     MOVEQ    #0,D1
  893. mtloop    MOVE.L    D1,D2
  894.     SUBQ.W    #1,D0
  895. mtloop2    MOVE.B    (A1)+,D1
  896.     CMP.B    D2,D1
  897.     BGT.S    mtloop
  898.     DBRA    D0,mtloop2
  899.     ADDQ.B    #1,D2
  900.             
  901.     LEA    mt_SampleStarts(PC),A1
  902.     ASL.L    #8,D2
  903.     ASL.L    #2,D2
  904.     ADD.L    #1084,D2
  905.     ADD.L    A0,D2
  906.     MOVE.L    D2,A2
  907.     MOVEQ    #30,D0
  908. mtloop3    CLR.L    (A2)
  909.     MOVE.L    A2,(A1)+
  910.     MOVEQ    #0,D1
  911.     MOVE.W    42(A0),D1
  912.     ASL.L    #1,D1
  913.     ADD.L    D1,A2
  914.     ADD.L    #30,A0
  915.     DBRA    D0,mtloop3
  916.  
  917.     OR.B    #2,$BFE001
  918.     MOVE.B    #6,mt_speed
  919.     CLR.B    mt_counter
  920.     CLR.B    mt_SongPos
  921.     CLR.W    mt_PatternPos
  922. mt_end    CLR.W    $DFF0A8
  923.     CLR.W    $DFF0B8
  924.     CLR.W    $DFF0C8
  925.     CLR.W    $DFF0D8
  926.     MOVE.W    #$F,$DFF096
  927.     RTS
  928.  
  929. mt_music
  930.     MOVEM.L    D0-D4/A0-A6,-(SP)
  931.     ADDQ.B    #1,mt_counter
  932.     MOVE.B    mt_counter(PC),D0
  933.     CMP.B    mt_speed(PC),D0
  934.     BLO.S    mt_NoNewNote
  935.     CLR.B    mt_counter
  936.     TST.B    mt_PattDelTime2
  937.     BEQ.S    mt_GetNewNote
  938.     BSR.S    mt_NoNewAllChannels
  939.     BRA    mt_dskip
  940.  
  941. mt_NoNewNote
  942.     BSR.S    mt_NoNewAllChannels
  943.     BRA    mt_NoNewPosYet
  944.  
  945. mt_NoNewAllChannels
  946.     LEA    $DFF0A0,A5
  947.     LEA    mt_chan1temp(PC),A6
  948.     BSR    mt_CheckEfx
  949.     LEA    $DFF0B0,A5
  950.     LEA    mt_chan2temp(PC),A6
  951.     BSR    mt_CheckEfx
  952.     LEA    $DFF0C0,A5
  953.     LEA    mt_chan3temp(PC),A6
  954.     BSR    mt_CheckEfx
  955.     LEA    $DFF0D0,A5
  956.     LEA    mt_chan4temp(PC),A6
  957.     BRA    mt_CheckEfx
  958.  
  959. mt_GetNewNote
  960.     MOVE.L    mt_SongDataPtr(PC),A0
  961.     LEA    12(A0),A3
  962.     LEA    952(A0),A2    ;pattpo
  963.     LEA    1084(A0),A0    ;patterndata
  964.     MOVEQ    #0,D0
  965.     MOVEQ    #0,D1
  966.     MOVE.B    mt_SongPos(PC),D0
  967.     MOVE.B    (A2,D0.W),D1
  968.     ASL.L    #8,D1
  969.     ASL.L    #2,D1
  970.     ADD.W    mt_PatternPos(PC),D1
  971.     CLR.W    mt_DMACONtemp
  972.  
  973.     LEA    $DFF0A0,A5
  974.     LEA    mt_chan1temp(PC),A6
  975.     BSR.S    mt_PlayVoice
  976.     LEA    $DFF0B0,A5
  977.     LEA    mt_chan2temp(PC),A6
  978.     BSR.S    mt_PlayVoice
  979.     LEA    $DFF0C0,A5
  980.     LEA    mt_chan3temp(PC),A6
  981.     BSR.S    mt_PlayVoice
  982.     LEA    $DFF0D0,A5
  983.     LEA    mt_chan4temp(PC),A6
  984.     BSR.S    mt_PlayVoice
  985.     BRA    mt_SetDMA
  986.  
  987. mt_PlayVoice
  988.     TST.L    (A6)
  989.     BNE.S    mt_plvskip
  990.     BSR    mt_PerNop
  991. mt_plvskip
  992.     MOVE.L    (A0,D1.L),(A6)
  993.     ADDQ.L    #4,D1
  994.     MOVEQ    #0,D2
  995.     MOVE.B    n_cmd(A6),D2
  996.     AND.B    #$F0,D2
  997.     LSR.B    #4,D2
  998.     MOVE.B    (A6),D0
  999.     AND.B    #$F0,D0
  1000.     OR.B    D0,D2
  1001.     TST.B    D2
  1002.     BEQ    mt_SetRegs
  1003.     MOVEQ    #0,D3
  1004.     LEA    mt_SampleStarts(PC),A1
  1005.     MOVE    D2,D4
  1006.     SUBQ.L    #1,D2
  1007.     ASL.L    #2,D2
  1008.     MULU    #30,D4
  1009.     MOVE.L    (A1,D2.L),n_start(A6)
  1010.     MOVE.W    (A3,D4.L),n_length(A6)
  1011.     MOVE.W    (A3,D4.L),n_reallength(A6)
  1012.     MOVE.B    2(A3,D4.L),n_finetune(A6)
  1013.     MOVE.B    3(A3,D4.L),n_volume(A6)
  1014.     MOVE.W    4(A3,D4.L),D3 ; Get repeat
  1015.     TST.W    D3
  1016.     BEQ.S    mt_NoLoop
  1017.     MOVE.L    n_start(A6),D2    ; Get start
  1018.     ASL.W    #1,D3
  1019.     ADD.L    D3,D2        ; Add repeat
  1020.     MOVE.L    D2,n_loopstart(A6)
  1021.     MOVE.L    D2,n_wavestart(A6)
  1022.     MOVE.W    4(A3,D4.L),D0    ; Get repeat
  1023.     ADD.W    6(A3,D4.L),D0    ; Add replen
  1024.     MOVE.W    D0,n_length(A6)
  1025.     MOVE.W    6(A3,D4.L),n_replen(A6)    ; Save replen
  1026.     MOVEQ    #0,D0
  1027.     MOVE.B    n_volume(A6),D0
  1028.     MOVE.W    D0,8(A5)    ; Set volume
  1029.     BRA.S    mt_SetRegs
  1030.  
  1031. mt_NoLoop
  1032.     MOVE.L    n_start(A6),D2
  1033.     ADD.L    D3,D2
  1034.     MOVE.L    D2,n_loopstart(A6)
  1035.     MOVE.L    D2,n_wavestart(A6)
  1036.     MOVE.W    6(A3,D4.L),n_replen(A6)    ; Save replen
  1037.     MOVEQ    #0,D0
  1038.     MOVE.B    n_volume(A6),D0
  1039.     MOVE.W    D0,8(A5)    ; Set volume
  1040. mt_SetRegs
  1041.     MOVE.W    (A6),D0
  1042.     AND.W    #$0FFF,D0
  1043.     BEQ    mt_CheckMoreEfx    ; If no note
  1044.     MOVE.W    2(A6),D0
  1045.     AND.W    #$0FF0,D0
  1046.     CMP.W    #$0E50,D0
  1047.     BEQ.S    mt_DoSetFineTune
  1048.     MOVE.B    2(A6),D0
  1049.     AND.B    #$0F,D0
  1050.     CMP.B    #3,D0    ; TonePortamento
  1051.     BEQ.S    mt_ChkTonePorta
  1052.     CMP.B    #5,D0
  1053.     BEQ.S    mt_ChkTonePorta
  1054.     CMP.B    #9,D0    ; Sample Offset
  1055.     BNE.S    mt_SetPeriod
  1056.     BSR    mt_CheckMoreEfx
  1057.     BRA.S    mt_SetPeriod
  1058.  
  1059. mt_DoSetFineTune
  1060.     BSR    mt_SetFineTune
  1061.     BRA.S    mt_SetPeriod
  1062.  
  1063. mt_ChkTonePorta
  1064.     BSR    mt_SetTonePorta
  1065.     BRA    mt_CheckMoreEfx
  1066.  
  1067. mt_SetPeriod
  1068.     MOVEM.L    D0-D1/A0-A1,-(SP)
  1069.     MOVE.W    (A6),D1
  1070.     AND.W    #$0FFF,D1
  1071.     LEA    mt_PeriodTable(PC),A1
  1072.     MOVEQ    #0,D0
  1073.     MOVEQ    #36,D7
  1074. mt_ftuloop
  1075.     CMP.W    (A1,D0.W),D1
  1076.     BHS.S    mt_ftufound
  1077.     ADDQ.L    #2,D0
  1078.     DBRA    D7,mt_ftuloop
  1079. mt_ftufound
  1080.     MOVEQ    #0,D1
  1081.     MOVE.B    n_finetune(A6),D1
  1082.     MULU    #36*2,D1
  1083.     ADD.L    D1,A1
  1084.     MOVE.W    (A1,D0.W),n_period(A6)
  1085.     MOVEM.L    (SP)+,D0-D1/A0-A1
  1086.  
  1087.     MOVE.W    2(A6),D0
  1088.     AND.W    #$0FF0,D0
  1089.     CMP.W    #$0ED0,D0 ; Notedelay
  1090.     BEQ    mt_CheckMoreEfx
  1091.  
  1092.     MOVE.W    n_dmabit(A6),$DFF096
  1093.     BTST    #2,n_wavecontrol(A6)
  1094.     BNE.S    mt_vibnoc
  1095.     CLR.B    n_vibratopos(A6)
  1096. mt_vibnoc
  1097.     BTST    #6,n_wavecontrol(A6)
  1098.     BNE.S    mt_trenoc
  1099.     CLR.B    n_tremolopos(A6)
  1100. mt_trenoc
  1101.     MOVE.L    n_start(A6),(A5)    ; Set start
  1102.     MOVE.W    n_length(A6),4(A5)    ; Set length
  1103.     MOVE.W    n_period(A6),D0
  1104.     MOVE.W    D0,6(A5)        ; Set period
  1105.     MOVE.W    n_dmabit(A6),D0
  1106.     OR.W    D0,mt_DMACONtemp
  1107.     BRA    mt_CheckMoreEfx
  1108.  
  1109. mt_SetDMA
  1110.     MOVE.W    #300,D0
  1111. mt_WaitDMA
  1112.     DBRA    D0,mt_WaitDMA
  1113.     MOVE.W    mt_DMACONtemp(PC),D0
  1114.     OR.W    #$8000,D0
  1115.     MOVE.W    D0,$DFF096
  1116.     MOVE.W    #300,D0
  1117. mt_WaitDMA2
  1118.     DBRA    D0,mt_WaitDMA2
  1119.  
  1120.     LEA    $DFF000,A5
  1121.     LEA    mt_chan4temp(PC),A6
  1122.     MOVE.L    n_loopstart(A6),$D0(A5)
  1123.     MOVE.W    n_replen(A6),$D4(A5)
  1124.     LEA    mt_chan3temp(PC),A6
  1125.     MOVE.L    n_loopstart(A6),$C0(A5)
  1126.     MOVE.W    n_replen(A6),$C4(A5)
  1127.     LEA    mt_chan2temp(PC),A6
  1128.     MOVE.L    n_loopstart(A6),$B0(A5)
  1129.     MOVE.W    n_replen(A6),$B4(A5)
  1130.     LEA    mt_chan1temp(PC),A6
  1131.     MOVE.L    n_loopstart(A6),$A0(A5)
  1132.     MOVE.W    n_replen(A6),$A4(A5)
  1133.  
  1134. mt_dskip
  1135.     ADD.W    #16,mt_PatternPos
  1136.     MOVE.B    mt_PattDelTime,D0
  1137.     BEQ.S    mt_dskc
  1138.     MOVE.B    D0,mt_PattDelTime2
  1139.     CLR.B    mt_PattDelTime
  1140. mt_dskc    TST.B    mt_PattDelTime2
  1141.     BEQ.S    mt_dska
  1142.     SUBQ.B    #1,mt_PattDelTime2
  1143.     BEQ.S    mt_dska
  1144.     SUB.W    #16,mt_PatternPos
  1145. mt_dska    TST.B    mt_PBreakFlag
  1146.     BEQ.S    mt_nnpysk
  1147.     SF    mt_PBreakFlag
  1148.     MOVEQ    #0,D0
  1149.     MOVE.B    mt_PBreakPos(PC),D0
  1150.     CLR.B    mt_PBreakPos
  1151.     LSL.W    #4,D0
  1152.     MOVE.W    D0,mt_PatternPos
  1153. mt_nnpysk
  1154.     CMP.W    #1024,mt_PatternPos
  1155.     BLO.S    mt_NoNewPosYet
  1156. mt_NextPosition    
  1157.     MOVEQ    #0,D0
  1158.     MOVE.B    mt_PBreakPos(PC),D0
  1159.     LSL.W    #4,D0
  1160.     MOVE.W    D0,mt_PatternPos
  1161.     CLR.B    mt_PBreakPos
  1162.     CLR.B    mt_PosJumpFlag
  1163.     ADDQ.B    #1,mt_SongPos
  1164.     AND.B    #$7F,mt_SongPos
  1165.     MOVE.B    mt_SongPos(PC),D1
  1166.     MOVE.L    mt_SongDataPtr(PC),A0
  1167.     CMP.B    950(A0),D1
  1168.     BLO.S    mt_NoNewPosYet
  1169.     CLR.B    mt_SongPos
  1170. mt_NoNewPosYet    
  1171.     TST.B    mt_PosJumpFlag
  1172.     BNE.S    mt_NextPosition
  1173.     MOVEM.L    (SP)+,D0-D4/A0-A6
  1174.     RTS
  1175.  
  1176. mt_CheckEfx
  1177.     BSR    mt_UpdateFunk
  1178.     MOVE.W    n_cmd(A6),D0
  1179.     AND.W    #$0FFF,D0
  1180.     BEQ.S    mt_PerNop
  1181.     MOVE.B    n_cmd(A6),D0
  1182.     AND.B    #$0F,D0
  1183.     BEQ.S    mt_Arpeggio
  1184.     CMP.B    #1,D0
  1185.     BEQ    mt_PortaUp
  1186.     CMP.B    #2,D0
  1187.     BEQ    mt_PortaDown
  1188.     CMP.B    #3,D0
  1189.     BEQ    mt_TonePortamento
  1190.     CMP.B    #4,D0
  1191.     BEQ    mt_Vibrato
  1192.     CMP.B    #5,D0
  1193.     BEQ    mt_TonePlusVolSlide
  1194.     CMP.B    #6,D0
  1195.     BEQ    mt_VibratoPlusVolSlide
  1196.     CMP.B    #$E,D0
  1197.     BEQ    mt_E_Commands
  1198. SetBack    MOVE.W    n_period(A6),6(A5)
  1199.     CMP.B    #7,D0
  1200.     BEQ    mt_Tremolo
  1201.     CMP.B    #$A,D0
  1202.     BEQ    mt_VolumeSlide
  1203. mt_Return2
  1204.     RTS
  1205.  
  1206. mt_PerNop
  1207.     MOVE.W    n_period(A6),6(A5)
  1208.     RTS
  1209.  
  1210. mt_Arpeggio
  1211.     MOVEQ    #0,D0
  1212.     MOVE.B    mt_counter(PC),D0
  1213.     DIVS    #3,D0
  1214.     SWAP    D0
  1215.     CMP.W    #0,D0
  1216.     BEQ.S    mt_Arpeggio2
  1217.     CMP.W    #2,D0
  1218.     BEQ.S    mt_Arpeggio1
  1219.     MOVEQ    #0,D0
  1220.     MOVE.B    n_cmdlo(A6),D0
  1221.     LSR.B    #4,D0
  1222.     BRA.S    mt_Arpeggio3
  1223.  
  1224. mt_Arpeggio1
  1225.     MOVEQ    #0,D0
  1226.     MOVE.B    n_cmdlo(A6),D0
  1227.     AND.B    #15,D0
  1228.     BRA.S    mt_Arpeggio3
  1229.  
  1230. mt_Arpeggio2
  1231.     MOVE.W    n_period(A6),D2
  1232.     BRA.S    mt_Arpeggio4
  1233.  
  1234. mt_Arpeggio3
  1235.     ASL.W    #1,D0
  1236.     MOVEQ    #0,D1
  1237.     MOVE.B    n_finetune(A6),D1
  1238.     MULU    #36*2,D1
  1239.     LEA    mt_PeriodTable(PC),A0
  1240.     ADD.L    D1,A0
  1241.     MOVEQ    #0,D1
  1242.     MOVE.W    n_period(A6),D1
  1243.     MOVEQ    #36,D7
  1244. mt_arploop
  1245.     MOVE.W    (A0,D0.W),D2
  1246.     CMP.W    (A0),D1
  1247.     BHS.S    mt_Arpeggio4
  1248.     ADDQ.L    #2,A0
  1249.     DBRA    D7,mt_arploop
  1250.     RTS
  1251.  
  1252. mt_Arpeggio4
  1253.     MOVE.W    D2,6(A5)
  1254.     RTS
  1255.  
  1256. mt_FinePortaUp
  1257.     TST.B    mt_counter
  1258.     BNE.S    mt_Return2
  1259.     MOVE.B    #$0F,mt_LowMask
  1260. mt_PortaUp
  1261.     MOVEQ    #0,D0
  1262.     MOVE.B    n_cmdlo(A6),D0
  1263.     AND.B    mt_LowMask(PC),D0
  1264.     MOVE.B    #$FF,mt_LowMask
  1265.     SUB.W    D0,n_period(A6)
  1266.     MOVE.W    n_period(A6),D0
  1267.     AND.W    #$0FFF,D0
  1268.     CMP.W    #113,D0
  1269.     BPL.S    mt_PortaUskip
  1270.     AND.W    #$F000,n_period(A6)
  1271.     OR.W    #113,n_period(A6)
  1272. mt_PortaUskip
  1273.     MOVE.W    n_period(A6),D0
  1274.     AND.W    #$0FFF,D0
  1275.     MOVE.W    D0,6(A5)
  1276.     RTS    
  1277.  
  1278. mt_FinePortaDown
  1279.     TST.B    mt_counter
  1280.     BNE    mt_Return2
  1281.     MOVE.B    #$0F,mt_LowMask
  1282. mt_PortaDown
  1283.     CLR.W    D0
  1284.     MOVE.B    n_cmdlo(A6),D0
  1285.     AND.B    mt_LowMask(PC),D0
  1286.     MOVE.B    #$FF,mt_LowMask
  1287.     ADD.W    D0,n_period(A6)
  1288.     MOVE.W    n_period(A6),D0
  1289.     AND.W    #$0FFF,D0
  1290.     CMP.W    #856,D0
  1291.     BMI.S    mt_PortaDskip
  1292.     AND.W    #$F000,n_period(A6)
  1293.     OR.W    #856,n_period(A6)
  1294. mt_PortaDskip
  1295.     MOVE.W    n_period(A6),D0
  1296.     AND.W    #$0FFF,D0
  1297.     MOVE.W    D0,6(A5)
  1298.     RTS
  1299.  
  1300. mt_SetTonePorta
  1301.     MOVE.L    A0,-(SP)
  1302.     MOVE.W    (A6),D2
  1303.     AND.W    #$0FFF,D2
  1304.     MOVEQ    #0,D0
  1305.     MOVE.B    n_finetune(A6),D0
  1306.     MULU    #37*2,D0
  1307.     LEA    mt_PeriodTable(PC),A0
  1308.     ADD.L    D0,A0
  1309.     MOVEQ    #0,D0
  1310. mt_StpLoop
  1311.     CMP.W    (A0,D0.W),D2
  1312.     BHS.S    mt_StpFound
  1313.     ADDQ.W    #2,D0
  1314.     CMP.W    #37*2,D0
  1315.     BLO.S    mt_StpLoop
  1316.     MOVEQ    #35*2,D0
  1317. mt_StpFound
  1318.     MOVE.B    n_finetune(A6),D2
  1319.     AND.B    #8,D2
  1320.     BEQ.S    mt_StpGoss
  1321.     TST.W    D0
  1322.     BEQ.S    mt_StpGoss
  1323.     SUBQ.W    #2,D0
  1324. mt_StpGoss
  1325.     MOVE.W    (A0,D0.W),D2
  1326.     MOVE.L    (SP)+,A0
  1327.     MOVE.W    D2,n_wantedperiod(A6)
  1328.     MOVE.W    n_period(A6),D0
  1329.     CLR.B    n_toneportdirec(A6)
  1330.     CMP.W    D0,D2
  1331.     BEQ.S    mt_ClearTonePorta
  1332.     BGE    mt_Return2
  1333.     MOVE.B    #1,n_toneportdirec(A6)
  1334.     RTS
  1335.  
  1336. mt_ClearTonePorta
  1337.     CLR.W    n_wantedperiod(A6)
  1338.     RTS
  1339.  
  1340. mt_TonePortamento
  1341.     MOVE.B    n_cmdlo(A6),D0
  1342.     BEQ.S    mt_TonePortNoChange
  1343.     MOVE.B    D0,n_toneportspeed(A6)
  1344.     CLR.B    n_cmdlo(A6)
  1345. mt_TonePortNoChange
  1346.     TST.W    n_wantedperiod(A6)
  1347.     BEQ    mt_Return2
  1348.     MOVEQ    #0,D0
  1349.     MOVE.B    n_toneportspeed(A6),D0
  1350.     TST.B    n_toneportdirec(A6)
  1351.     BNE.S    mt_TonePortaUp
  1352. mt_TonePortaDown
  1353.     ADD.W    D0,n_period(A6)
  1354.     MOVE.W    n_wantedperiod(A6),D0
  1355.     CMP.W    n_period(A6),D0
  1356.     BGT.S    mt_TonePortaSetPer
  1357.     MOVE.W    n_wantedperiod(A6),n_period(A6)
  1358.     CLR.W    n_wantedperiod(A6)
  1359.     BRA.S    mt_TonePortaSetPer
  1360.  
  1361. mt_TonePortaUp
  1362.     SUB.W    D0,n_period(A6)
  1363.     MOVE.W    n_wantedperiod(A6),D0
  1364.     CMP.W    n_period(A6),D0
  1365.     BLT.S    mt_TonePortaSetPer
  1366.     MOVE.W    n_wantedperiod(A6),n_period(A6)
  1367.     CLR.W    n_wantedperiod(A6)
  1368.  
  1369. mt_TonePortaSetPer
  1370.     MOVE.W    n_period(A6),D2
  1371.     MOVE.B    n_glissfunk(A6),D0
  1372.     AND.B    #$0F,D0
  1373.     BEQ.S    mt_GlissSkip
  1374.     MOVEQ    #0,D0
  1375.     MOVE.B    n_finetune(A6),D0
  1376.     MULU    #36*2,D0
  1377.     LEA    mt_PeriodTable(PC),A0
  1378.     ADD.L    D0,A0
  1379.     MOVEQ    #0,D0
  1380. mt_GlissLoop
  1381.     CMP.W    (A0,D0.W),D2
  1382.     BHS.S    mt_GlissFound
  1383.     ADDQ.W    #2,D0
  1384.     CMP.W    #36*2,D0
  1385.     BLO.S    mt_GlissLoop
  1386.     MOVEQ    #35*2,D0
  1387. mt_GlissFound
  1388.     MOVE.W    (A0,D0.W),D2
  1389. mt_GlissSkip
  1390.     MOVE.W    D2,6(A5) ; Set period
  1391.     RTS
  1392.  
  1393. mt_Vibrato
  1394.     MOVE.B    n_cmdlo(A6),D0
  1395.     BEQ.S    mt_Vibrato2
  1396.     MOVE.B    n_vibratocmd(A6),D2
  1397.     AND.B    #$0F,D0
  1398.     BEQ.S    mt_vibskip
  1399.     AND.B    #$F0,D2
  1400.     OR.B    D0,D2
  1401. mt_vibskip
  1402.     MOVE.B    n_cmdlo(A6),D0
  1403.     AND.B    #$F0,D0
  1404.     BEQ.S    mt_vibskip2
  1405.     AND.B    #$0F,D2
  1406.     OR.B    D0,D2
  1407. mt_vibskip2
  1408.     MOVE.B    D2,n_vibratocmd(A6)
  1409. mt_Vibrato2
  1410.     MOVE.B    n_vibratopos(A6),D0
  1411.     LEA    mt_VibratoTable(PC),A4
  1412.     LSR.W    #2,D0
  1413.     AND.W    #$001F,D0
  1414.     MOVEQ    #0,D2
  1415.     MOVE.B    n_wavecontrol(A6),D2
  1416.     AND.B    #$03,D2
  1417.     BEQ.S    mt_vib_sine
  1418.     LSL.B    #3,D0
  1419.     CMP.B    #1,D2
  1420.     BEQ.S    mt_vib_rampdown
  1421.     MOVE.B    #255,D2
  1422.     BRA.S    mt_vib_set
  1423. mt_vib_rampdown
  1424.     TST.B    n_vibratopos(A6)
  1425.     BPL.S    mt_vib_rampdown2
  1426.     MOVE.B    #255,D2
  1427.     SUB.B    D0,D2
  1428.     BRA.S    mt_vib_set
  1429. mt_vib_rampdown2
  1430.     MOVE.B    D0,D2
  1431.     BRA.S    mt_vib_set
  1432. mt_vib_sine
  1433.     MOVE.B    0(A4,D0.W),D2
  1434. mt_vib_set
  1435.     MOVE.B    n_vibratocmd(A6),D0
  1436.     AND.W    #15,D0
  1437.     MULU    D0,D2
  1438.     LSR.W    #7,D2
  1439.     MOVE.W    n_period(A6),D0
  1440.     TST.B    n_vibratopos(A6)
  1441.     BMI.S    mt_VibratoNeg
  1442.     ADD.W    D2,D0
  1443.     BRA.S    mt_Vibrato3
  1444. mt_VibratoNeg
  1445.     SUB.W    D2,D0
  1446. mt_Vibrato3
  1447.     MOVE.W    D0,6(A5)
  1448.     MOVE.B    n_vibratocmd(A6),D0
  1449.     LSR.W    #2,D0
  1450.     AND.W    #$003C,D0
  1451.     ADD.B    D0,n_vibratopos(A6)
  1452.     RTS
  1453.  
  1454. mt_TonePlusVolSlide
  1455.     BSR    mt_TonePortNoChange
  1456.     BRA    mt_VolumeSlide
  1457.  
  1458. mt_VibratoPlusVolSlide
  1459.     BSR.S    mt_Vibrato2
  1460.     BRA    mt_VolumeSlide
  1461.  
  1462. mt_Tremolo
  1463.     MOVE.B    n_cmdlo(A6),D0
  1464.     BEQ.S    mt_Tremolo2
  1465.     MOVE.B    n_tremolocmd(A6),D2
  1466.     AND.B    #$0F,D0
  1467.     BEQ.S    mt_treskip
  1468.     AND.B    #$F0,D2
  1469.     OR.B    D0,D2
  1470. mt_treskip
  1471.     MOVE.B    n_cmdlo(A6),D0
  1472.     AND.B    #$F0,D0
  1473.     BEQ.S    mt_treskip2
  1474.     AND.B    #$0F,D2
  1475.     OR.B    D0,D2
  1476. mt_treskip2
  1477.     MOVE.B    D2,n_tremolocmd(A6)
  1478. mt_Tremolo2
  1479.     MOVE.B    n_tremolopos(A6),D0
  1480.     LEA    mt_VibratoTable(PC),A4
  1481.     LSR.W    #2,D0
  1482.     AND.W    #$001F,D0
  1483.     MOVEQ    #0,D2
  1484.     MOVE.B    n_wavecontrol(A6),D2
  1485.     LSR.B    #4,D2
  1486.     AND.B    #$03,D2
  1487.     BEQ.S    mt_tre_sine
  1488.     LSL.B    #3,D0
  1489.     CMP.B    #1,D2
  1490.     BEQ.S    mt_tre_rampdown
  1491.     MOVE.B    #255,D2
  1492.     BRA.S    mt_tre_set
  1493. mt_tre_rampdown
  1494.     TST.B    n_vibratopos(A6)
  1495.     BPL.S    mt_tre_rampdown2
  1496.     MOVE.B    #255,D2
  1497.     SUB.B    D0,D2
  1498.     BRA.S    mt_tre_set
  1499. mt_tre_rampdown2
  1500.     MOVE.B    D0,D2
  1501.     BRA.S    mt_tre_set
  1502. mt_tre_sine
  1503.     MOVE.B    0(A4,D0.W),D2
  1504. mt_tre_set
  1505.     MOVE.B    n_tremolocmd(A6),D0
  1506.     AND.W    #15,D0
  1507.     MULU    D0,D2
  1508.     LSR.W    #6,D2
  1509.     MOVEQ    #0,D0
  1510.     MOVE.B    n_volume(A6),D0
  1511.     TST.B    n_tremolopos(A6)
  1512.     BMI.S    mt_TremoloNeg
  1513.     ADD.W    D2,D0
  1514.     BRA.S    mt_Tremolo3
  1515. mt_TremoloNeg
  1516.     SUB.W    D2,D0
  1517. mt_Tremolo3
  1518.     BPL.S    mt_TremoloSkip
  1519.     CLR.W    D0
  1520. mt_TremoloSkip
  1521.     CMP.W    #$40,D0
  1522.     BLS.S    mt_TremoloOk
  1523.     MOVE.W    #$40,D0
  1524. mt_TremoloOk
  1525.     MOVE.W    D0,8(A5)
  1526.     MOVE.B    n_tremolocmd(A6),D0
  1527.     LSR.W    #2,D0
  1528.     AND.W    #$003C,D0
  1529.     ADD.B    D0,n_tremolopos(A6)
  1530.     RTS
  1531.  
  1532. mt_SampleOffset
  1533.     MOVEQ    #0,D0
  1534.     MOVE.B    n_cmdlo(A6),D0
  1535.     BEQ.S    mt_sononew
  1536.     MOVE.B    D0,n_sampleoffset(A6)
  1537. mt_sononew
  1538.     MOVE.B    n_sampleoffset(A6),D0
  1539.     LSL.W    #7,D0
  1540.     CMP.W    n_length(A6),D0
  1541.     BGE.S    mt_sofskip
  1542.     SUB.W    D0,n_length(A6)
  1543.     LSL.W    #1,D0
  1544.     ADD.L    D0,n_start(A6)
  1545.     RTS
  1546. mt_sofskip
  1547.     MOVE.W    #$0001,n_length(A6)
  1548.     RTS
  1549.  
  1550. mt_VolumeSlide
  1551.     MOVEQ    #0,D0
  1552.     MOVE.B    n_cmdlo(A6),D0
  1553.     LSR.B    #4,D0
  1554.     TST.B    D0
  1555.     BEQ.S    mt_VolSlideDown
  1556. mt_VolSlideUp
  1557.     ADD.B    D0,n_volume(A6)
  1558.     CMP.B    #$40,n_volume(A6)
  1559.     BMI.S    mt_vsuskip
  1560.     MOVE.B    #$40,n_volume(A6)
  1561. mt_vsuskip
  1562.     MOVE.B    n_volume(A6),D0
  1563.     MOVE.W    D0,8(A5)
  1564.     RTS
  1565.  
  1566. mt_VolSlideDown
  1567.     MOVEQ    #0,D0
  1568.     MOVE.B    n_cmdlo(A6),D0
  1569.     AND.B    #$0F,D0
  1570. mt_VolSlideDown2
  1571.     SUB.B    D0,n_volume(A6)
  1572.     BPL.S    mt_vsdskip
  1573.     CLR.B    n_volume(A6)
  1574. mt_vsdskip
  1575.     MOVE.B    n_volume(A6),D0
  1576.     MOVE.W    D0,8(A5)
  1577.     RTS
  1578.  
  1579. mt_PositionJump
  1580.     MOVE.B    n_cmdlo(A6),D0
  1581.     SUBQ.B    #1,D0
  1582.     MOVE.B    D0,mt_SongPos
  1583. mt_pj2    CLR.B    mt_PBreakPos
  1584.     ST     mt_PosJumpFlag
  1585.     RTS
  1586.  
  1587. mt_VolumeChange
  1588.     MOVEQ    #0,D0
  1589.     MOVE.B    n_cmdlo(A6),D0
  1590.     CMP.B    #$40,D0
  1591.     BLS.S    mt_VolumeOk
  1592.     MOVEQ    #$40,D0
  1593. mt_VolumeOk
  1594.     MOVE.B    D0,n_volume(A6)
  1595.     MOVE.W    D0,8(A5)
  1596.     RTS
  1597.  
  1598. mt_PatternBreak
  1599.     MOVEQ    #0,D0
  1600.     MOVE.B    n_cmdlo(A6),D0
  1601.     MOVE.L    D0,D2
  1602.     LSR.B    #4,D0
  1603.     MULU    #10,D0
  1604.     AND.B    #$0F,D2
  1605.     ADD.B    D2,D0
  1606.     CMP.B    #63,D0
  1607.     BHI.S    mt_pj2
  1608.     MOVE.B    D0,mt_PBreakPos
  1609.     ST    mt_PosJumpFlag
  1610.     RTS
  1611.  
  1612. mt_SetSpeed
  1613.     MOVE.B    3(A6),D0
  1614.     BEQ    mt_Return2
  1615.     CLR.B    mt_counter
  1616.     MOVE.B    D0,mt_speed
  1617.     RTS
  1618.  
  1619. mt_CheckMoreEfx
  1620.     BSR    mt_UpdateFunk
  1621.     MOVE.B    2(A6),D0
  1622.     AND.B    #$0F,D0
  1623.     CMP.B    #$9,D0
  1624.     BEQ    mt_SampleOffset
  1625.     CMP.B    #$B,D0
  1626.     BEQ    mt_PositionJump
  1627.     CMP.B    #$D,D0
  1628.     BEQ.S    mt_PatternBreak
  1629.     CMP.B    #$E,D0
  1630.     BEQ.S    mt_E_Commands
  1631.     CMP.B    #$F,D0
  1632.     BEQ.S    mt_SetSpeed
  1633.     CMP.B    #$C,D0
  1634.     BEQ    mt_VolumeChange
  1635.     BRA    mt_PerNop
  1636.  
  1637. mt_E_Commands
  1638.     MOVE.B    n_cmdlo(A6),D0
  1639.     AND.B    #$F0,D0
  1640.     LSR.B    #4,D0
  1641.     BEQ.S    mt_FilterOnOff
  1642.     CMP.B    #1,D0
  1643.     BEQ    mt_FinePortaUp
  1644.     CMP.B    #2,D0
  1645.     BEQ    mt_FinePortaDown
  1646.     CMP.B    #3,D0
  1647.     BEQ.S    mt_SetGlissControl
  1648.     CMP.B    #4,D0
  1649.     BEQ    mt_SetVibratoControl
  1650.     CMP.B    #5,D0
  1651.     BEQ    mt_SetFineTune
  1652.     CMP.B    #6,D0
  1653.     BEQ    mt_JumpLoop
  1654.     CMP.B    #7,D0
  1655.     BEQ    mt_SetTremoloControl
  1656.     CMP.B    #9,D0
  1657.     BEQ    mt_RetrigNote
  1658.     CMP.B    #$A,D0
  1659.     BEQ    mt_VolumeFineUp
  1660.     CMP.B    #$B,D0
  1661.     BEQ    mt_VolumeFineDown
  1662.     CMP.B    #$C,D0
  1663.     BEQ    mt_NoteCut
  1664.     CMP.B    #$D,D0
  1665.     BEQ    mt_NoteDelay
  1666.     CMP.B    #$E,D0
  1667.     BEQ    mt_PatternDelay
  1668.     CMP.B    #$F,D0
  1669.     BEQ    mt_FunkIt
  1670.     RTS
  1671.  
  1672. mt_FilterOnOff
  1673.     MOVE.B    n_cmdlo(A6),D0
  1674.     AND.B    #1,D0
  1675.     ASL.B    #1,D0
  1676.     AND.B    #$FD,$BFE001
  1677.     OR.B    D0,$BFE001
  1678.     RTS    
  1679.  
  1680. mt_SetGlissControl
  1681.     MOVE.B    n_cmdlo(A6),D0
  1682.     AND.B    #$0F,D0
  1683.     AND.B    #$F0,n_glissfunk(A6)
  1684.     OR.B    D0,n_glissfunk(A6)
  1685.     RTS
  1686.  
  1687. mt_SetVibratoControl
  1688.     MOVE.B    n_cmdlo(A6),D0
  1689.     AND.B    #$0F,D0
  1690.     AND.B    #$F0,n_wavecontrol(A6)
  1691.     OR.B    D0,n_wavecontrol(A6)
  1692.     RTS
  1693.  
  1694. mt_SetFineTune
  1695.     MOVE.B    n_cmdlo(A6),D0
  1696.     AND.B    #$0F,D0
  1697.     MOVE.B    D0,n_finetune(A6)
  1698.     RTS
  1699.  
  1700. mt_JumpLoop
  1701.     TST.B    mt_counter
  1702.     BNE    mt_Return2
  1703.     MOVE.B    n_cmdlo(A6),D0
  1704.     AND.B    #$0F,D0
  1705.     BEQ.S    mt_SetLoop
  1706.     TST.B    n_loopcount(A6)
  1707.     BEQ.S    mt_jumpcnt
  1708.     SUBQ.B    #1,n_loopcount(A6)
  1709.     BEQ    mt_Return2
  1710. mt_jmploop    MOVE.B    n_pattpos(A6),mt_PBreakPos
  1711.     ST    mt_PBreakFlag
  1712.     RTS
  1713.  
  1714. mt_jumpcnt
  1715.     MOVE.B    D0,n_loopcount(A6)
  1716.     BRA.S    mt_jmploop
  1717.  
  1718. mt_SetLoop
  1719.     MOVE.W    mt_PatternPos(PC),D0
  1720.     LSR.W    #4,D0
  1721.     MOVE.B    D0,n_pattpos(A6)
  1722.     RTS
  1723.  
  1724. mt_SetTremoloControl
  1725.     MOVE.B    n_cmdlo(A6),D0
  1726.     AND.B    #$0F,D0
  1727.     LSL.B    #4,D0
  1728.     AND.B    #$0F,n_wavecontrol(A6)
  1729.     OR.B    D0,n_wavecontrol(A6)
  1730.     RTS
  1731.  
  1732. mt_RetrigNote
  1733.     MOVE.L    D1,-(SP)
  1734.     MOVEQ    #0,D0
  1735.     MOVE.B    n_cmdlo(A6),D0
  1736.     AND.B    #$0F,D0
  1737.     BEQ.S    mt_rtnend
  1738.     MOVEQ    #0,D1
  1739.     MOVE.B    mt_counter(PC),D1
  1740.     BNE.S    mt_rtnskp
  1741.     MOVE.W    (A6),D1
  1742.     AND.W    #$0FFF,D1
  1743.     BNE.S    mt_rtnend
  1744.     MOVEQ    #0,D1
  1745.     MOVE.B    mt_counter(PC),D1
  1746. mt_rtnskp
  1747.     DIVU    D0,D1
  1748.     SWAP    D1
  1749.     TST.W    D1
  1750.     BNE.S    mt_rtnend
  1751. mt_DoRetrig
  1752.     MOVE.W    n_dmabit(A6),$DFF096    ; Channel DMA off
  1753.     MOVE.L    n_start(A6),(A5)    ; Set sampledata pointer
  1754.     MOVE.W    n_length(A6),4(A5)    ; Set length
  1755.     MOVE.W    #300,D0
  1756. mt_rtnloop1
  1757.     DBRA    D0,mt_rtnloop1
  1758.     MOVE.W    n_dmabit(A6),D0
  1759.     BSET    #15,D0
  1760.     MOVE.W    D0,$DFF096
  1761.     MOVE.W    #300,D0
  1762. mt_rtnloop2
  1763.     DBRA    D0,mt_rtnloop2
  1764.     MOVE.L    n_loopstart(A6),(A5)
  1765.     MOVE.L    n_replen(A6),4(A5)
  1766. mt_rtnend
  1767.     MOVE.L    (SP)+,D1
  1768.     RTS
  1769.  
  1770. mt_VolumeFineUp
  1771.     TST.B    mt_counter
  1772.     BNE    mt_Return2
  1773.     MOVEQ    #0,D0
  1774.     MOVE.B    n_cmdlo(A6),D0
  1775.     AND.B    #$F,D0
  1776.     BRA    mt_VolSlideUp
  1777.  
  1778. mt_VolumeFineDown
  1779.     TST.B    mt_counter
  1780.     BNE    mt_Return2
  1781.     MOVEQ    #0,D0
  1782.     MOVE.B    n_cmdlo(A6),D0
  1783.     AND.B    #$0F,D0
  1784.     BRA    mt_VolSlideDown2
  1785.  
  1786. mt_NoteCut
  1787.     MOVEQ    #0,D0
  1788.     MOVE.B    n_cmdlo(A6),D0
  1789.     AND.B    #$0F,D0
  1790.     CMP.B    mt_counter(PC),D0
  1791.     BNE    mt_Return2
  1792.     CLR.B    n_volume(A6)
  1793.     MOVE.W    #0,8(A5)
  1794.     RTS
  1795.  
  1796. mt_NoteDelay
  1797.     MOVEQ    #0,D0
  1798.     MOVE.B    n_cmdlo(A6),D0
  1799.     AND.B    #$0F,D0
  1800.     CMP.B    mt_Counter,D0
  1801.     BNE    mt_Return2
  1802.     MOVE.W    (A6),D0
  1803.     BEQ    mt_Return2
  1804.     MOVE.L    D1,-(SP)
  1805.     BRA    mt_DoRetrig
  1806.  
  1807. mt_PatternDelay
  1808.     TST.B    mt_counter
  1809.     BNE    mt_Return2
  1810.     MOVEQ    #0,D0
  1811.     MOVE.B    n_cmdlo(A6),D0
  1812.     AND.B    #$0F,D0
  1813.     TST.B    mt_PattDelTime2
  1814.     BNE    mt_Return2
  1815.     ADDQ.B    #1,D0
  1816.     MOVE.B    D0,mt_PattDelTime
  1817.     RTS
  1818.  
  1819. mt_FunkIt
  1820.     TST.B    mt_counter
  1821.     BNE    mt_Return2
  1822.     MOVE.B    n_cmdlo(A6),D0
  1823.     AND.B    #$0F,D0
  1824.     LSL.B    #4,D0
  1825.     AND.B    #$0F,n_glissfunk(A6)
  1826.     OR.B    D0,n_glissfunk(A6)
  1827.     TST.B    D0
  1828.     BEQ    mt_Return2
  1829. mt_UpdateFunk
  1830.     MOVEM.L    A0/D1,-(SP)
  1831.     MOVEQ    #0,D0
  1832.     MOVE.B    n_glissfunk(A6),D0
  1833.     LSR.B    #4,D0
  1834.     BEQ.S    mt_funkend
  1835.     LEA    mt_FunkTable(PC),A0
  1836.     MOVE.B    (A0,D0.W),D0
  1837.     ADD.B    D0,n_funkoffset(A6)
  1838.     BTST    #7,n_funkoffset(A6)
  1839.     BEQ.S    mt_funkend
  1840.     CLR.B    n_funkoffset(A6)
  1841.  
  1842.     MOVE.L    n_loopstart(A6),D0
  1843.     MOVEQ    #0,D1
  1844.     MOVE.W    n_replen(A6),D1
  1845.     ADD.L    D1,D0
  1846.     ADD.L    D1,D0
  1847.     MOVE.L    n_wavestart(A6),A0
  1848.     ADDQ.L    #1,A0
  1849.     CMP.L    D0,A0
  1850.     BLO.S    mt_funkok
  1851.     MOVE.L    n_loopstart(A6),A0
  1852. mt_funkok
  1853.     MOVE.L    A0,n_wavestart(A6)
  1854.     MOVEQ    #-1,D0
  1855.     SUB.B    (A0),D0
  1856.     MOVE.B    D0,(A0)
  1857. mt_funkend
  1858.     MOVEM.L    (SP)+,A0/D1
  1859.     RTS
  1860.  
  1861.  
  1862. mt_FunkTable dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128
  1863.  
  1864. mt_VibratoTable    
  1865.     dc.b   0, 24, 49, 74, 97,120,141,161
  1866.     dc.b 180,197,212,224,235,244,250,253
  1867.     dc.b 255,253,250,244,235,224,212,197
  1868.     dc.b 180,161,141,120, 97, 74, 49, 24
  1869.  
  1870. mt_PeriodTable
  1871. ; Tuning 0, Normal
  1872.     dc.w    856,808,762,720,678,640,604,570,538,508,480,453
  1873.     dc.w    428,404,381,360,339,320,302,285,269,254,240,226
  1874.     dc.w    214,202,190,180,170,160,151,143,135,127,120,113
  1875. ; Tuning 1
  1876.     dc.w    850,802,757,715,674,637,601,567,535,505,477,450
  1877.     dc.w    425,401,379,357,337,318,300,284,268,253,239,225
  1878.     dc.w    213,201,189,179,169,159,150,142,134,126,119,113
  1879. ; Tuning 2
  1880.     dc.w    844,796,752,709,670,632,597,563,532,502,474,447
  1881.     dc.w    422,398,376,355,335,316,298,282,266,251,237,224
  1882.     dc.w    211,199,188,177,167,158,149,141,133,125,118,112
  1883. ; Tuning 3
  1884.     dc.w    838,791,746,704,665,628,592,559,528,498,470,444
  1885.     dc.w    419,395,373,352,332,314,296,280,264,249,235,222
  1886.     dc.w    209,198,187,176,166,157,148,140,132,125,118,111
  1887. ; Tuning 4
  1888.     dc.w    832,785,741,699,660,623,588,555,524,495,467,441
  1889.     dc.w    416,392,370,350,330,312,294,278,262,247,233,220
  1890.     dc.w    208,196,185,175,165,156,147,139,131,124,117,110
  1891. ; Tuning 5
  1892.     dc.w    826,779,736,694,655,619,584,551,520,491,463,437
  1893.     dc.w    413,390,368,347,328,309,292,276,260,245,232,219
  1894.     dc.w    206,195,184,174,164,155,146,138,130,123,116,109
  1895. ; Tuning 6
  1896.     dc.w    820,774,730,689,651,614,580,547,516,487,460,434
  1897.     dc.w    410,387,365,345,325,307,290,274,258,244,230,217
  1898.     dc.w    205,193,183,172,163,154,145,137,129,122,115,109
  1899. ; Tuning 7
  1900.     dc.w    814,768,725,684,646,610,575,543,513,484,457,431
  1901.     dc.w    407,384,363,342,323,305,288,272,256,242,228,216
  1902.     dc.w    204,192,181,171,161,152,144,136,128,121,114,108
  1903. ; Tuning -8
  1904.     dc.w    907,856,808,762,720,678,640,604,570,538,508,480
  1905.     dc.w    453,428,404,381,360,339,320,302,285,269,254,240
  1906.     dc.w    226,214,202,190,180,170,160,151,143,135,127,120
  1907. ; Tuning -7
  1908.     dc.w    900,850,802,757,715,675,636,601,567,535,505,477
  1909.     dc.w    450,425,401,379,357,337,318,300,284,268,253,238
  1910.     dc.w    225,212,200,189,179,169,159,150,142,134,126,119
  1911. ; Tuning -6
  1912.     dc.w    894,844,796,752,709,670,632,597,563,532,502,474
  1913.     dc.w    447,422,398,376,355,335,316,298,282,266,251,237
  1914.     dc.w    223,211,199,188,177,167,158,149,141,133,125,118
  1915. ; Tuning -5
  1916.     dc.w    887,838,791,746,704,665,628,592,559,528,498,470
  1917.     dc.w    444,419,395,373,352,332,314,296,280,264,249,235
  1918.     dc.w    222,209,198,187,176,166,157,148,140,132,125,118
  1919. ; Tuning -4
  1920.     dc.w    881,832,785,741,699,660,623,588,555,524,494,467
  1921.     dc.w    441,416,392,370,350,330,312,294,278,262,247,233
  1922.     dc.w    220,208,196,185,175,165,156,147,139,131,123,117
  1923. ; Tuning -3
  1924.     dc.w    875,826,779,736,694,655,619,584,551,520,491,463
  1925.     dc.w    437,413,390,368,347,328,309,292,276,260,245,232
  1926.     dc.w    219,206,195,184,174,164,155,146,138,130,123,116
  1927. ; Tuning -2
  1928.     dc.w    868,820,774,730,689,651,614,580,547,516,487,460
  1929.     dc.w    434,410,387,365,345,325,307,290,274,258,244,230
  1930.     dc.w    217,205,193,183,172,163,154,145,137,129,122,115
  1931. ; Tuning -1
  1932.     dc.w    862,814,768,725,684,646,610,575,543,513,484,457
  1933.     dc.w    431,407,384,363,342,323,305,288,272,256,242,228
  1934.     dc.w    216,203,192,181,171,161,152,144,136,128,121,114
  1935.  
  1936. mt_chan1temp    dc.l    0,0,0,0,0,$00010000,0,  0,0,0,0
  1937. mt_chan2temp    dc.l    0,0,0,0,0,$00020000,0,  0,0,0,0
  1938. mt_chan3temp    dc.l    0,0,0,0,0,$00040000,0,  0,0,0,0
  1939. mt_chan4temp    dc.l    0,0,0,0,0,$00080000,0,  0,0,0,0
  1940.  
  1941. mt_SampleStarts    dc.l    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1942.         dc.l    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1943.  
  1944. mt_SongDataPtr    dc.l 0
  1945.  
  1946. mt_speed    dc.b 6
  1947. mt_counter    dc.b 0
  1948. mt_SongPos    dc.b 0
  1949. mt_PBreakPos    dc.b 0
  1950. mt_PosJumpFlag    dc.b 0
  1951. mt_PBreakFlag    dc.b 0
  1952. mt_LowMask    dc.b 0
  1953. mt_PattDelTime    dc.b 0
  1954. mt_PattDelTime2    dc.b 0,0
  1955.  
  1956. mt_PatternPos    dc.w 0
  1957. mt_DMACONtemp    dc.w 0
  1958.  
  1959. ;/* End of File */
  1960.  
  1961.         
  1962. gen_balls:
  1963.     move.l    Screen1,d0
  1964.     add.l    #44*40,d0
  1965.     move.w    d0,bitplane0_lo
  1966.     swap    d0
  1967.     move.w    d0,bitplane0_hi
  1968.     swap    d0
  1969.     add.l    #wide*down,d0    
  1970.     move.w    d0,bitplane1_lo
  1971.     swap    d0
  1972.     move.w    d0,bitplane1_hi
  1973.     swap    d0
  1974.     add.l    #wide*down,d0    
  1975.     move.w    d0,bitplane2_lo
  1976.     swap    d0
  1977.     move.w    d0,bitplane2_hi
  1978.  
  1979.     move.l    scr,d0
  1980.     move.w    d0,bitplane3_lo
  1981.     swap    d0
  1982.     move.w    d0,bitplane3_hi
  1983.  
  1984.     move.l    screen2,a0
  1985.     add.l    #42*40+6,a0
  1986.  
  1987.     bsr    do_blit    
  1988.     move.l    a0,$dff054             ; dest mem d
  1989.     move.w    #%0001*256,$dff040        ; blit cont reg 0
  1990.     move.w    #%0,$dff042            ; blit cont reg 1
  1991.     Move.w    #10,$dff066            ; modulo for dest
  1992.     Move.w    #(171*64)+15,$dff058        ; blit height,width
  1993.     
  1994.     add.l    #wide*down,a0
  1995.     bsr    do_blit    
  1996.     move.l    a0,$dff054             ; dest mem d
  1997.     Move.w    #(171*64)+15,$dff058        ; blit height,width
  1998.  
  1999.     add.l    #wide*down,a0
  2000.     bsr    do_blit    
  2001.     move.l    a0,$dff054             ; dest mem d
  2002.     Move.w    #(171*64)+15,$dff058        ; blit height,width
  2003.  
  2004.  
  2005.     lea    coordsend1,a0
  2006.     move.l    offset1,a1
  2007.     cmpa.l    a0,a1
  2008.     blt.s    coords_ok1
  2009.     move.l    #coords1,offset1
  2010. coords_ok1:
  2011.  
  2012.     lea    coordsend1,a0
  2013.     move.l    offset2,a1
  2014.     cmpa.l    a0,a1
  2015.     blt.s    coords_ok2
  2016.     move.l    #coords1,offset2
  2017. coords_ok2:
  2018.  
  2019.     move.l    offset1,a0
  2020.     move.l    offset2,a1
  2021.     add.l    #1,a1
  2022.  
  2023.     move.w    #maxx,d7
  2024.  
  2025.     lea    $dff000,a5        ; set base address of hardware
  2026.     
  2027. more_balls1:    
  2028.     
  2029.     move.l    #0,d0
  2030.     move.l    d0,d1
  2031.     
  2032.     move.b    (a0),d0
  2033.     move.b    (a1),d1
  2034.     
  2035.     add.l    xs2,a0
  2036.     add.l    ys2,a1
  2037.  
  2038.     bsr    do_ball
  2039.     dbf    d7,more_balls1
  2040.  
  2041.     move.l    screen1,a1
  2042.     move.l    screen2,a0
  2043.     move.l    a0,screen1
  2044.     move.l    a1,screen2
  2045.  
  2046.     move.l    xs1,d0
  2047.     move.l    ys1,d1
  2048.  
  2049.     add.l    d0,offset1
  2050.     add.l    d1,offset2
  2051.     rts
  2052.     
  2053.  
  2054. do_ball:
  2055.     movem.l    d0-d7/a0-a6,-(sp)
  2056.  
  2057.     add.w    #20,d0
  2058.  
  2059.     move.w    d0,d2
  2060.     and.w    #$000f,d2
  2061.     ror.w    #4,d2                ; mul by 4096
  2062.     and.w    #$fff0,d0
  2063.     lsr.w    #3,d0                ; div by 8
  2064.  
  2065.     move.w    d1,d7
  2066.     mulu    #40,d7
  2067.  
  2068.     add.w    d0,d7
  2069.     move.w    #%1111*256+$ca,d4
  2070.     add.w    d2,d4
  2071.  
  2072.     move.l    screen2,a0
  2073.     add.l    d7,a0
  2074.     
  2075.     bsr    do_blit
  2076.  
  2077.     move.l    a0,$54(a5)            ; dest mem d
  2078.     Move.l    #mask+(0*15),$50(a5)        ; source mem a
  2079.     move.l    #ball+(0*15)+16,$4c(a5)        ; source mem b
  2080.     move.l    a0,$48(a5)            ; source mem c
  2081.     move.w    #-2,$64(a5)            ; source a modulo
  2082.     move.w    #wide-4,$60(a5)            ; source b modulo
  2083.     move.w    #-2,$62(a5)             ; source c modulo
  2084.     Move.w    #$ffff,$44(a5)            ; blit 1st word mask source a
  2085.     Move.w    #$0000,$46(a5)            ; blit last word mask source a    
  2086.     move.w    d4,$40(a5)            ; blit cont reg 0
  2087.     move.w    d2,$42(a5)            ; blit cont reg 1
  2088.     Move.w    #wide-4,$66(a5)            ; modulo for dest
  2089.     Move.w    #(15*64)+2,$58(a5)        ; blit height,width
  2090.  
  2091.     add.l    #wide*down,a0
  2092.     bsr    do_blit
  2093.  
  2094.     move.l    a0,$54(a5)            ; dest mem d
  2095.     Move.l    #mask+(2*15),$50(a5)        ; source mem a
  2096.     move.l    #ball+(2*15)+16,$4c(a5)        ; source mem b
  2097.     move.l    a0,$48(a5)            ; source mem c
  2098.     ;move.w    #-2,$64(a5)            ; source a modulo
  2099.     ;move.w    #wide-4,$60(a5)            ; source b modulo
  2100.     ;move.w    #-2,$62(a5)             ; source c modulo
  2101.     ;Move.w    #$ffff,$44(a5)            ; blit 1st word mask source a
  2102.     ;Move.w    #$0000,$46(a5)            ; blit last word mask source a    
  2103.     ;move.w    d4,$40(a5)            ; blit cont reg 0
  2104.     ;move.w    d2,$42(a5)            ; blit cont reg 1
  2105.     ;Move.w    #wide-4,$66(a5)            ; modulo for dest
  2106.     Move.w    #(15*64)+2,$58(a5)        ; blit height,width
  2107.  
  2108.     add.l    #wide*down,a0    
  2109.     bsr    do_blit
  2110.  
  2111.     move.l    a0,$54(a5)            ; dest mem d
  2112.     Move.l    #mask+(4*15),$50(a5)        ; source mem a
  2113.     move.l    #ball+(4*15)+16,$4c(a5)        ; source mem b
  2114.     move.l    a0,$48(a5)            ; source mem c
  2115.     ;move.w    #-2,$64(a5)            ; source a modulo
  2116.     ;move.w    #wide-4,$60(a5)            ; source b modulo
  2117.     ;move.w    #-2,$62(a5)             ; source c modulo
  2118.     ;Move.w    #$ffff,$44(a5)            ; blit 1st word mask source a
  2119.     ;Move.w    #$0000,$46(a5)            ; blit last word mask source a    
  2120.     ;move.w    d4,$40(a5)            ; blit cont reg 0
  2121.     ;move.w    d2,$42(a5)            ; blit cont reg 1
  2122.     ;Move.w    #wide-4,$66(a5)            ; modulo for dest
  2123.     Move.w    #(15*64)+2,$58(a5)        ; blit height,width
  2124.  
  2125.  
  2126.     movem.l    (sp)+,d0-d7/a0-a6    
  2127.     rts
  2128.  
  2129.  
  2130. begin2:        dc.l    0
  2131.  
  2132.     
  2133.     Section    copdat,Data_C
  2134.  
  2135. old_copper:    dc.l    0
  2136. graphics:    dc.l    0
  2137.  
  2138. my_copper:    
  2139.         dc.w    $100,$4200    ; 4 bp - lo res
  2140.         dc.w    $104,$4a        ; bp control reg
  2141.         dc.w    $108,0        ; bp modulo - odd
  2142.         dc.w    $10a,0        ; bp modulo - even
  2143.         dc.w    forecol,0    ; colour 0 to black
  2144.         dc.w    $102,0
  2145.         
  2146.         dc.w    $08e,$287b    ; bp window start left
  2147.         dc.w    $090,$2fc1    ; bp window bot right
  2148.         dc.w    $94,$d0        ; bp stop horz
  2149.         dc.w    $92,$38
  2150.         dc.w    $120
  2151. sprite1_hi:    dc.w    0
  2152.         dc.w    $122
  2153. sprite1_lo:    dc.w    0
  2154.  
  2155.         
  2156. logocmap:    dc.w    $180,$0
  2157.         dc.w    $182,$0
  2158.         dc.w    $184,$0
  2159.         dc.w    $186,$0
  2160.         dc.w    $188,$0
  2161.         dc.w    $18a,$0
  2162.         dc.w    $18c,$0
  2163.         dc.w    $18e,$0
  2164.         dc.w    $190,$0
  2165.         dc.w    $192,$0
  2166.         dc.w    $194,$0
  2167.         dc.w    $196,$0
  2168.         dc.w    $198,$0
  2169.         dc.w    $19a,$0
  2170.         dc.w    $19c,$0
  2171.         dc.w    $19e,$0
  2172.  
  2173.         dc.w      $e0
  2174. bplane0_hi:    dc.w    0,$e2
  2175. bplane0_lo:    dc.w    0,$e4
  2176. bplane1_hi:    dc.w    0,$e6
  2177. bplane1_lo:    dc.w    0,$e8
  2178. bplane2_hi:    dc.w    0,$ea
  2179. bplane2_lo:    dc.w    0,$ec
  2180. bplane3_hi:    dc.w    0,$ee
  2181. bplane3_lo:    dc.w    0
  2182.  
  2183.         dc.w    $5a01,$ff00
  2184.         
  2185.         dc.w      $e0
  2186. bitplane0_hi:    dc.w    0,$e2
  2187. bitplane0_lo:    dc.w    0,$e4
  2188. bitplane1_hi:    dc.w    0,$e6
  2189. bitplane1_lo:    dc.w    0,$e8
  2190. bitplane2_hi:    dc.w    0,$ea
  2191. bitplane2_lo:    dc.w    0,$ec
  2192. bitplane3_hi:    dc.w    0,$ee
  2193. bitplane3_lo:    dc.w    0
  2194.         
  2195.         dc.w    forecol,$000
  2196.         dc.w    $182,$0
  2197.         dc.w    $184,$0
  2198.         dc.w    $186,$0
  2199.         dc.w    $188,$0
  2200.         dc.w    $18a,$0
  2201.         dc.w    $18c,$0
  2202.         dc.w    $18e,$0
  2203.         dc.w    $190,$fff
  2204.         dc.w    $192,$fff
  2205.         dc.w    $194,$fff
  2206.         dc.w    $196,$fff
  2207.         dc.w    $198,$fff
  2208.         dc.w    $19a,$fff
  2209.         dc.w    $19c,$fff
  2210.         dc.w    $19e,$fff
  2211.     
  2212. cmap:        dc.w    $1fe,$000
  2213.         dc.w    $182,$000
  2214.         dc.w    $184,$000
  2215.         dc.w    $186,$000
  2216.         dc.w    $188,$000
  2217.         dc.w    $18a,$000
  2218.         dc.w    $18c,$000
  2219.         dc.w    $18e,$000
  2220.  
  2221. a set topcur
  2222. cursor1:        dc.w    a+$000,$ff00
  2223.         dc.w    forecol,$444
  2224.         dc.w    $190,linecol
  2225.         dc.w    $192,linecol
  2226.         dc.w    $194,linecol
  2227.         dc.w    $196,linecol
  2228.         dc.w    $198,linecol
  2229.         dc.w    $19a,linecol
  2230.         dc.w    $19c,linecol
  2231.         dc.w    $19e,linecol
  2232. cursor2:    dc.w    a+$100,$ff00
  2233.         dc.w    forecol,$666
  2234. cursor3:    dc.w    a+$200,$ff00
  2235.         dc.w    forecol,$888
  2236. cursor4:    dc.w    a+$300,$ff00
  2237.         dc.w    forecol,$aaa
  2238. cursor5:    dc.w    a+$400,$ff00
  2239.         dc.w    forecol,$ccc
  2240. cursor6:    dc.w    a+$500,$ff00
  2241.         dc.w    forecol,$eee
  2242. cursor7:    dc.w    a+$600,$ff00
  2243.         dc.w    forecol,$ccc
  2244. cursor8:    dc.w    a+$700,$ff00
  2245.         dc.w    forecol,$aaa
  2246. cursor9:    dc.w    a+$800,$ff00
  2247.         dc.w    forecol,$888
  2248. cursor10:    dc.w    a+$900,$ff00
  2249.         dc.w    forecol,$666
  2250. cursor11:    dc.w    a+$a00,$ff00
  2251.         dc.w    forecol,$444
  2252. cursor12:    dc.w    a+$b00,$ff00
  2253.         dc.w    forecol,$000
  2254.  
  2255.         dc.w    $190,$fff
  2256.         dc.w    $192,$fff
  2257.         dc.w    $194,$fff
  2258.         dc.w    $196,$fff
  2259.         dc.w    $198,$fff
  2260.         dc.w    $19a,$fff
  2261.         dc.w    $19c,$fff
  2262.         dc.w    $19e,$fff
  2263.  
  2264.         dc.w    $ffe1,$fffe    ; end of ntsc screen
  2265.  
  2266.         dc.w    $0101,$ff00
  2267.  
  2268.         dc.w    $182,$000
  2269.         dc.w    $184,$000
  2270.         dc.w    $186,$000
  2271.         dc.w    $188,$000
  2272.         dc.w    $18a,$000
  2273.         dc.w    $18c,$000
  2274.         dc.w    $18e,$000
  2275.  
  2276.         dc.w    $0501,$ff00,forecol,$fff
  2277.         dc.w    $0601,$ff00,forecol,$000,textcol,$f00
  2278.  
  2279.  
  2280.  
  2281. v set $1001
  2282.         dc.w    v,$ff00,$094,$d8,$92,$30,$102
  2283. scrollpos:    dc.w    0
  2284.  
  2285.  
  2286.         dc.w    v+$100,$ff00,forecol,$fff
  2287.         dc.w    v+$200,$ff00,forecol,$000,textcol,$fff
  2288.  
  2289. v set v+$1000
  2290.         dc.w    v,$ff00
  2291.         dc.w    $10a,-44*2
  2292.  
  2293. a set $8
  2294. b set $fff
  2295. c set v+$100
  2296.         rept 8
  2297.         dc.w    c,$ff00
  2298.         dc.w    forecol,a
  2299.         dc.w    textcol,b
  2300.     
  2301. a set a-1
  2302. b set b-$222
  2303. c set c+$100
  2304.         endr
  2305.         
  2306.         dc.w    $100,0        
  2307.         
  2308.         dc.w    $3001,$ff00    ; end of pal screen
  2309.         dc.w    $9c,$8010    ; irq set bits
  2310.         dc.w    $ffff,$fffe    ; end of copper list
  2311.  
  2312.  
  2313. ball:        incbin    "bulb.bin"
  2314. mask:        incbin    "bulb.msk"
  2315.  
  2316.  
  2317. copper2:
  2318.         dc.w    $102,0
  2319.         dc.w    $100,$1200    ; 1 bp - lo res
  2320.         dc.w    $104,$a        ; bp control reg
  2321.         dc.w    $108,0        ; bp modulo - odd
  2322.         dc.w    $10a,0        ; bp modulo - even
  2323.         dc.w    forecol,0    ; colour 0 to black
  2324.  
  2325.         dc.w    $08e,$7f81    ; bp window start left
  2326.         dc.w    $090,$7fc1    ; bp window bot right
  2327.         dc.w    $94,$c0        ; bp stop 
  2328.         dc.w    $92,$40        ; bp start
  2329.         dc.w    $120,0,$122,0
  2330.         
  2331.         dc.w      $e0
  2332. bp0_hi:        dc.w    0,$e2
  2333. bp0_lo:        dc.w    0
  2334.     
  2335.         
  2336.         dc.w    forecol,$000
  2337.         dc.w    $182,$fff
  2338.  
  2339. a set $7f01
  2340. b set $00f
  2341. c set $0f0
  2342.         rept    14
  2343.         dc.w    a,$ff00,$182,b,$102,4
  2344. a set a+$100
  2345. b set b+$110
  2346.         endr
  2347.         rept    14
  2348.         dc.w    a,$ff00,$182,b,$102,4
  2349. a set a+$100
  2350. b set b-$110
  2351.         endr
  2352.         
  2353.         dc.w    $9c01,$ff00,$100,$0,$102,0
  2354.  
  2355.         dc.w    $ffe1,$fffe    ; end of ntsc screen        
  2356.         dc.w    $3001,$ff00    ; end of pal screen
  2357.         dc.w    $9c,$8010    ; irq set bits
  2358.         dc.w    $ffff,$fffe    ; end of copper list
  2359.  
  2360. font:        incbin    "fonts/keff12.wrd"    ;
  2361.  
  2362.         ***** logo goes here ****
  2363.  
  2364.         ; it must be lo-res, 16 colours
  2365.         ; 320 x 50, colour map before!
  2366.         ; cut out with kefrens converter
  2367.  
  2368. logo:        incbin    "logo.bin"
  2369.  
  2370.  
  2371.  
  2372.  
  2373.         ;**********************************
  2374.         ;********   module name  **********
  2375.         ;**********************************
  2376.         
  2377. mt_data:    incbin    "df2:mod.daffy4"
  2378.         dc.l    $12345678    ; rem the above line for no module
  2379.  
  2380.     section    miscdata,data
  2381.         
  2382. down        equ    256
  2383. wide:        equ    40
  2384.     
  2385. maxx:        equ    24
  2386.     
  2387. scrsize:        equ    wide*down*3
  2388.  
  2389. screen:        dc.l    0
  2390. screen1:    dc.l    0
  2391. screen2:    dc.l    0 
  2392.         
  2393. offset1:        dc.l    coords1
  2394. offset2:        dc.l    coords1
  2395.  
  2396. mid:        dc.l    0
  2397. midadd:        dc.l    0
  2398. page:        dc.l    0
  2399. scr:        dc.l    0
  2400.  
  2401. glib:        dc.b    "graphics.library",0
  2402.     even
  2403.     
  2404. modpointerx:    dc.l    $1f0
  2405. modpointery:    dc.l    $1f4
  2406.  
  2407. xs1:        dc.l    xstep1*2
  2408. ys1:        dc.l    ystep1*2
  2409. xs2:        dc.l    xstep2*2
  2410. ys2:        dc.l    ystep2*2
  2411.  
  2412. scrollmask:    dc.l    0
  2413. delay:        dc.l    400
  2414. maxlines:    dc.l    0
  2415. lines:        dc.l    0
  2416. ypos:        dc.l    256
  2417. xpos:        dc.l    0
  2418. oldy:        dc.l    0
  2419. yp:        dc.l    0
  2420. quit:        dc.l    0
  2421. step:        dc.l    0
  2422. oldintena:    dc.w    0
  2423. oldintreq:    dc.w    0
  2424.  
  2425. filename:    dc.l    0
  2426.  
  2427.     
  2428. scrollpos2:    dc.l    0
  2429. SegAdd:        dc.l    0
  2430. DOSBase:    dc.l    0
  2431. doslib:        dc.b    "dos.library",0
  2432.         even        
  2433.  
  2434.  
  2435. info:
  2436.     dc.b    " ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0," ",0
  2437.     dc.b    "VECTORS CHECKED - YOU ARE VIRUS FREE!",0,0
  2438.     even    
  2439.     
  2440. flist:    dc.l    file1    
  2441.     dc.l    file2
  2442.     dc.l    file3    
  2443.     dc.l    file4    
  2444.     dc.l    file5    
  2445.     dc.l    file6    
  2446.     dc.l    file7    
  2447.     dc.l    file8    
  2448.     dc.l    file9    
  2449.     dc.l    file10    
  2450.     dc.l    file11
  2451.     dc.l    file12
  2452.     dc.l    file13
  2453.     dc.l    file14
  2454.     dc.l    file15
  2455.     
  2456. coords1:    incbin    "sine/introlist12"    ; can be 1 - 19
  2457. coordsend1:    dcb.l    maxx*32,0
  2458.         even
  2459.         
  2460. page1:
  2461.     dc.b    "SOME DEMOS",0
  2462.     dc.b    " ",0
  2463.     dc.b    "1",0
  2464.     dc.b    "2",0
  2465.     dc.b    "3",0
  2466.     dc.b    "4",0
  2467.     dc.b    "5",0
  2468.     dc.b    "6",0
  2469.     dc.b    "7",0
  2470.     dc.b    "8",0
  2471.     dc.b    "9",0
  2472.     dc.b    "a",0
  2473.     dc.b    0,0
  2474.  
  2475.     even
  2476.  
  2477. file1:    dc.b    "",0
  2478.     even
  2479. file2:    dc.b    "",0
  2480.     even
  2481. file3:    dc.b    "1",0
  2482.     even
  2483. file4:    dc.b    "2",0
  2484.     even
  2485. file5:    dc.b    "3",0
  2486.     even
  2487. file6:    dc.b    "4",0
  2488.     even
  2489. file7:    dc.b    "5",0
  2490.     even
  2491. file8:    dc.b    "6",0
  2492.     even
  2493. file9:    dc.b    "7",0
  2494.     even
  2495. file10:    dc.b    "8",0
  2496.     even
  2497. file11:    dc.b    "9",0
  2498.     even
  2499. file12:    dc.b    "a",0
  2500.     even
  2501. file13:    dc.b    "",0
  2502.     even
  2503. file14:    dc.b    "",0
  2504.     even
  2505. file15:    dc.b    "",0
  2506.     even
  2507.  
  2508. scrolltext:
  2509.     dc.b    "PLEASE ONLY USE LSD MUSIC, RIP SOME FROM PAZZAs MENUS OR ASK IF YOU NEED ANY.       "
  2510.     dc.b    "MENU CODED BY SHAGRATT, LOGO BY WATCHMAN, FONTS BY KEFRENS, MUSIC BY ??/LSD"
  2511.     dc.b    ""
  2512.     dc.b    ""
  2513.     dc.b    ""
  2514.     dc.b    ""
  2515.     dc.b    0
  2516.     even
  2517.  
  2518. scrollptr:    dc.l    scrolltext
  2519.  
  2520.     end
  2521.  
  2522.